7 months ago
I'm trying to connect my NextJs application to a Postgres database, but Private Networking isn't working. Using Public Networking works perfectly. Do I need to configure anything else?
Attachments
Pinned Solution
7 months ago
https://docs.railway.com/reference/private-networking#caveats
It is not available during the build process. I hope that answers your query
Attachments
4 Replies
7 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 errno: -3008, code: 'ENOTFOUND', #syscall: 'getaddrinfo', hostname: 'postgres.railway.internal'
🧵 Nextjs and node server not able to communicate over private networking
🧵 Suddenly can't connect privately using postgres.railway.internal
If you find the answer from one of these, please let us know by solving the thread!
7 months ago
https://docs.railway.com/guides/private-networking#node--next
For the server to talk via private networking, it should listen on IPv6. Specifically, for your nextJS application, you can update your start command to bind to both IPv4 and IPv6. (as prescribed in the documentation):
next start --hostname :: --port ${PORT-3000}
Change the port according to your needs & refer to the linked documentation page to get a better understanding of what needs to be done.
If that helps to resolve your issue, do mark this as the solution 
7 months ago
Unfortunately, the error persists. It seems I can't access the database via private network during the project's build phase.
fabriziofeitosa
Unfortunately, the error persists. It seems I can't access the database via private network during the project's build phase.
7 months ago
https://docs.railway.com/reference/private-networking#caveats
It is not available during the build process. I hope that answers your query
Attachments
Status changed to Solved christian • 7 months ago

