Error: connect ETIMEDOUT 34.105.6.84:5432

I created a PostgreSQL database on Railway, then linked my NodeJS backend project from github, added the DB environment variables, but I get this error when deploying: original: Error: connect ETIMEDOUT 34.105.6.84:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16) { errno: -110, code: 'ETIMEDOUT', syscall: 'connect', how can I fix it?
21 Replies
Percy
Percy2y ago
Project ID: c03ab519-eb18-4616-8389-d7ce0f9c5d04
antoniosilvaz
antoniosilvazOP2y ago
Service ID: c03ab519-eb18-4616-8389-d7ce0f9c5d04
Brody
Brody2y ago
show me a screenshot of your railway service variables please
antoniosilvaz
antoniosilvazOP2y ago
I copied the variables from what the DB generates for me
Brody
Brody2y ago
delete all database variables. add all the variable references available for the database https://docs.railway.app/develop/variables#reference-variables
antoniosilvaz
antoniosilvazOP2y ago
Done, now I get this error: original: Error: getaddrinfo ENOTFOUND undefined at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'undefined'
Brody
Brody2y ago
show me a screenshot of your railway service variables please
antoniosilvaz
antoniosilvazOP2y ago
Brody
Brody2y ago
and show me how you are using those variables in your code please
antoniosilvaz
antoniosilvazOP2y ago
Brody
Brody2y ago
you don't need a .env file delete it then whe running your app locally use railway run <the command you normally use to start your app>
antoniosilvaz
antoniosilvazOP2y ago
But, they were not uploaded to the github repository
Brody
Brody2y ago
I'm only trying to help
antoniosilvaz
antoniosilvazOP2y ago
Brody
Brody2y ago
you need to install the railway cli first lol
antoniosilvaz
antoniosilvazOP2y ago
Sorry, l never used railway before I have uploaded this page in render, but it is a bit slow, I wanted to test how it works in Railway
Brody
Brody2y ago
show me how you are using those variables in your code please
antoniosilvaz
antoniosilvazOP2y ago
Ignore errors 😅 , it works
Brody
Brody2y ago
again, you don't need a .env file, so subsequently you don't need the dotenv loader remove that
antoniosilvaz
antoniosilvazOP2y ago
ok
Brody
Brody2y ago
let me know when done show code screenshot again please
Want results from more Discord servers?
Add your server