Backend Not Connecting to PostgreSQL and Redis
ryux411
HOBBYOP

a year ago

Hi Railway Support,

I am currently facing an issue with my backend deployment. I’ve successfully configured both PostgreSQL and Redis to be accessed via Railway’s private network, but my backend continues to fail to connect to both services, even though I have followed all the configuration steps carefully.

Error Details:

  • PostgreSQL: The backend connects to PostgreSQL initially, but fails to establish a stable connection.

  • Redis: The backend is unable to connect to Redis, showing the error ENOTFOUND undefined, indicating the hostname cannot be resolved.

Configurations:

  • I am using the internal network addresses (postgres.railway.internal for PostgreSQL and redis.railway.internal for Redis), but the connection attempts are not resolving correctly.

  • The .env file is correctly set up with the connection strings, and I am using the appropriate environment variables in my code.

What I’ve Tried:

  • I have updated the .env to include both PostgreSQL and Redis details (private network URLs).

  • I have tried switching the Redis connection to use dual-stack lookup (family=0 in the URL).

  • I have ensured that both the backend and database services are within the same Railway project and environment.

Despite all efforts, I keep receiving the following errors in the logs:

  • PostgreSQL Error:Error connecting to PostgreSQL: getaddrinfo ENOTFOUND postgres.railway.internal

  • Redis Error:Error connecting to Redis: getaddrinfo ENOTFOUND undefined

Request for Assistance:
Could you please assist me in resolving these connection issues? Specifically, I’m looking for guidance on ensuring that the backend correctly resolves and connects to the PostgreSQL and Redis services using Railway’s private network.

I am using the latest versions of the required packages (pg, ioredis, and dotenv), and I’ve set the backend to use ES modules as required.

Solved

0 Replies

ryux411
HOBBYOP

a year ago

92f4bf28-94c3-4d17-9dcf-1169563f4ed9


ryux411
HOBBYOP

a year ago

1329971626611179500
1329971626896523300


ryux411
HOBBYOP

a year ago

1329972373163606000


ryux411
HOBBYOP

a year ago

I'm terrible at this<:kekw:788259314607325204> I have been trying and trying.. just nothing..


brody
EMPLOYEE

a year ago

can you send me a full browser screenshot


ryux411
HOBBYOP

a year ago

1329972782674739500


brody
EMPLOYEE

a year ago

can you disable ad block


ryux411
HOBBYOP

a year ago

I have been looking like for hours trying to fix this, I guess I am just really stuck at this point.


ryux411
HOBBYOP

a year ago

1moment


ryux411
HOBBYOP

a year ago

1329973276205650000


brody
EMPLOYEE

a year ago

refresh, and show me another screenshot please


ryux411
HOBBYOP

a year ago

1329974030505218000


ryux411
HOBBYOP

a year ago

Is this problem sort of related to the browser I am on?


brody
EMPLOYEE

a year ago

yes, lets debug so that you can help save people in your situation


brody
EMPLOYEE

a year ago

can you open that project in incognito?


ryux411
HOBBYOP

a year ago

Sure


ryux411
HOBBYOP

a year ago

Would you like me to share screen?


ryux411
HOBBYOP

a year ago

1329975918600654800


brody
EMPLOYEE

a year ago

is that the same browser?


ryux411
HOBBYOP

a year ago

Yes


ryux411
HOBBYOP

a year ago

Brave Browser


brody
EMPLOYEE

a year ago

you can now see the missing deploy button right?


ryux411
HOBBYOP

a year ago

Yeah look at this after I clicked that "deploy button" button.. it made 2 changes

1329976428736811000


ryux411
HOBBYOP

a year ago

Now everything is good.. man did I think it was my terrible coding skills


brody
EMPLOYEE

a year ago

well i also undid a bunch of things you shouldnt have done


ryux411
HOBBYOP

a year ago

What have I done wrong?


brody
EMPLOYEE

a year ago

you just tried setting so many things in your effort to get it working


brody
EMPLOYEE

a year ago

not important though


ryux411
HOBBYOP

a year ago

Too many variables and certain?


brody
EMPLOYEE

a year ago

but you can understand your original issue, you did not see the deploy button when you wernt in incognito


brody
EMPLOYEE

a year ago

missing deploy button was the issue


ryux411
HOBBYOP

a year ago

It would be best to use a different browser ?


brody
EMPLOYEE

a year ago

no, we would like to fix this


ryux411
HOBBYOP

a year ago

Sure, what else can I help with?


brody
EMPLOYEE

a year ago

to fix this we would need to reproduce your setup so that we can also see a missing deploy button on our machines


brody
EMPLOYEE

a year ago

so switch back to your regular browser user and start disableing extentions one by one until the button comes back


ryux411
HOBBYOP

a year ago

That button is supposed to be there all the time?


brody
EMPLOYEE

a year ago

whenever there is a change you can apply, yes


brody
EMPLOYEE

a year ago

like right now

1329977867194597400


ryux411
HOBBYOP

a year ago

These are my only extensions used.

1329978009427513600


ryux411
HOBBYOP

a year ago

1329978092999151600


brody
EMPLOYEE

a year ago

is the button missing right now?


ryux411
HOBBYOP

a year ago

No.

1329978232019226600
1329978232400904200


brody
EMPLOYEE

a year ago

are you in incognito still?


ryux411
HOBBYOP

a year ago

No


brody
EMPLOYEE

a year ago

we haven't changed anything


brody
EMPLOYEE

a year ago

so im at a loss here


ryux411
HOBBYOP

a year ago

Huh so am I


brody
EMPLOYEE

a year ago

enable ad block again and reload?


ryux411
HOBBYOP

a year ago

1329978832819847200


ryux411
HOBBYOP

a year ago

This is weird, would you like me to restart my PC to start over trouble shooting?


brody
EMPLOYEE

a year ago

whatever it takes, if you can figure out the clear reproducible root cause ill give you a bounty of $20 in railway credits


ryux411
HOBBYOP

a year ago

Enabled


ryux411
HOBBYOP

a year ago

1329979420936765400
1329979421393682400


ryux411
HOBBYOP

a year ago

Disabled

1329979493418274800
1329979493724717000


brody
EMPLOYEE

a year ago

well that was fast


ryux411
HOBBYOP

a year ago

Suddenly came across my mind.. after you mentioned the extensions im using


brody
EMPLOYEE

a year ago

i'll verify this on our side, and if its reproducible, you will have yourself $20 in credits


ryux411
HOBBYOP

a year ago

Sweet, glad I could help


brody
EMPLOYEE

a year ago

do you need to be logged into the proton extension for it to erase the button?


ryux411
HOBBYOP

a year ago

Hold on


ryux411
HOBBYOP

a year ago

Only Proton Enabled

1329980413007102000
1329980413296246800


ryux411
HOBBYOP

a year ago

Only Dark Mode Reader Enabled

1329980605147910100
1329980605492101000


ryux411
HOBBYOP

a year ago

There you go

1329980719346221000
1329980719702868000


brody
EMPLOYEE

a year ago

so that dark mode thing is the issue


ryux411
HOBBYOP

a year ago

1329980829400567800


ryux411
HOBBYOP

a year ago

The extension not even being used but turned on, is already making the button dissapear. Dark Mode reader once clicked makes websites turn into dark mode..


brody
EMPLOYEE

a year ago

can you send the link to that extention?


ryux411
HOBBYOP

a year ago

Sure hold on



brody
EMPLOYEE

a year ago

oh wow that really messes up the ui


brody
EMPLOYEE

a year ago

in so many ways


ryux411
HOBBYOP

a year ago

Glad we found out, teached me a few things


brody
EMPLOYEE

a year ago

we can't fix that on our side, you would need to not use it while on railway


ryux411
HOBBYOP

a year ago

Yeah no worries, I will keep it disabled. Railway has a cool UI already compared to all these flashy websites =}


brody
EMPLOYEE

a year ago

either way, credits have been awarded


ryux411
HOBBYOP

a year ago

And if this is not a bug, I don't expect any reward. I am already very glad having my back-end configured the way it should be lol


ryux411
HOBBYOP

a year ago

Oh lol


ryux411
HOBBYOP

a year ago

Thank you very much


brody
EMPLOYEE

a year ago

not a bug on our side, but I'm a man of my word


ryux411
HOBBYOP

a year ago

Glad I moved to Railway, truly makes a difference


brody
EMPLOYEE

a year ago

I'm happy you're happy, and if I may ask, where did you move from?


ryux411
HOBBYOP

a year ago

I started with Heroku long time ago, eventually moved on to render. But in this whole time I was looking for something more centralised and user friendly compared to all these paywalls and nothing being unified. That sort of when I found out about Railway on youtube..


brody
EMPLOYEE

a year ago

who's YouTube if you don't mind me asking?


ryux411
HOBBYOP

a year ago

Hmm that's something I need to look up


brody
EMPLOYEE

a year ago

no worries if you don't know off the top of your head


brody
EMPLOYEE

a year ago

I only hope that you used their referral code 😉


ryux411
HOBBYOP

a year ago

Oh I must have missed that lol, It was about a video related to "Best hosting platforms" or something and since watching that I didn't hestitate trying out Railway until couple weeks ago..


brody
EMPLOYEE

a year ago

that's awesome, I'm glad we caught your eye


ryux411
HOBBYOP

a year ago

Anyways thank you very much, and truly see potential of how driven the community is here compared to …


brody
EMPLOYEE

a year ago

we hope you stick around!


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody 11 months ago


Loading...