a year ago
Hi! I'm trying to connect to a railway db but am getting this error on my terminal. (node:5447) ExperimentalWarning: Watch mode is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)
app listening on port 3000!
Database connection error: Error: getaddrinfo ENOTFOUND postgres.railway.internal
at /home/orion/repos/Members-Only/nodemodules/pg-pool/index.js:45:11 at process.processTicksAndRejections (node:internal/process/taskqueues:95:5)
/home/orion/repos/Members-Only/node_modules/pg-pool/index.js:45
Error.captureStackTrace(err)
^
Error: getaddrinfo ENOTFOUND postgres.railway.internal
at /home/orion/repos/Members-Only/nodemodules/pg-pool/index.js:45:11 at process.processTicksAndRejections (node:internal/process/taskqueues:95:5)
at async getPgVersion (/home/orion/repos/Members-Only/app.js:24:20) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'postgres.railway.internal'
}
Also can i have a pooled connection in railway?
8 Replies
I've also been getting data link communication failure when I deploy my springboot application on railway, I tried using railway mysql DB internal URL and even the public URL but nothing worked.
I decided to test with the public URL to make things easier it worked on my machine but when I tried to deploy on railway I got the same error.
my configurations are correct so I just don't understand why I keep getting this error and how to fix it.
Yeah I cant really find whats causing the problem. I tried using another db service (neon) but that again would make my app crash, I think I'll just switch to a different servive
refer to the answer I got on my post
https://discord.com/channels/713503345364697088/1322559921790648370/1322559921790648370
a year ago
You need to use the public domain, if you are connecting to the database from your terminal
a year ago
postgres.railway.internal is the private domain of your postgresql db and can only be accessed through other services in the same project environment
a year ago
Use DATABASE_PUBLIC_URL instead of DATABASE_URL
