Cannot Connect to Railway Database
orion-barjamaj
TRIALOP

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

orion-barjamaj
TRIALOP

a year ago

030bf563-af07-4a13-b0ee-c40af8664ae6


aradhyasharma31
TRIAL

a year ago

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.


aradhyasharma31
TRIAL

a year ago

here's my project ID: 10afb000-203e-438d-9108-8ad754e966b6


orion-barjamaj
TRIALOP

a year ago

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


aradhyasharma31
TRIAL

a year ago


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

1322581122248478700


Loading...