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
Project ID:
c03ab519-eb18-4616-8389-d7ce0f9c5d04
Service ID: c03ab519-eb18-4616-8389-d7ce0f9c5d04
show me a screenshot of your railway service variables please
I copied the variables from what the DB generates for me
delete all database variables.
add all the variable references available for the database
https://docs.railway.app/develop/variables#reference-variables
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'
show me a screenshot of your railway service variables please
and show me how you are using those variables in your code please
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>
But, they were not uploaded to the github repository
I'm only trying to help
you need to install the railway cli first lol
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
show me how you are using those variables in your code please
Ignore errors 😅 , it works
again, you don't need a .env file, so subsequently you don't need the dotenv loader
remove that
ok
let me know when done
show code screenshot again please