Unable to connect neon postgres db from railway
ars123z
TRIALOP

2 years ago

I am getting errors why trying to connect to neon postgres db from railway it works perfectly in local though. I am providing the logs as an attachment to this post.My project id is eda4e600-d3ed-4224-bb9b-127162c8c0c9

Closed

23 Replies

2 years ago

are you using environment variables? and do you have the needed variables set?


ars123z
TRIALOP

2 years ago

Yes it's set correctly


ars123z
TRIALOP

2 years ago

I checked that multiple times


2 years ago

maybe not, can you show me a screenshot of your variables tab? keep the variables hidden


ars123z
TRIALOP

2 years ago

Here it is

1287776787593564190


2 years ago

looks good, show me how you are consuming them in code


ars123z
TRIALOP

2 years ago

Can I share you the GitHub repo



ars123z
TRIALOP

2 years ago

I have to directly add the parameters to make it work


2 years ago

its not.


ars123z
TRIALOP

2 years ago

I changed it just now it's working this way only


2 years ago

please use environment variables


ars123z
TRIALOP

2 years ago

I am trying but it's just not working


2 years ago

let me know when you have used environment variables


ars123z
TRIALOP

2 years ago

I think this is a bug railway is not reading the postgres db environment variables correctly


2 years ago

i'm sorry but that would be incorrect


ars123z
TRIALOP

2 years ago

The moment I am trying to use any environment variables in there ,i am facing bunch of connection errors.without them the application is running fine


2 years ago

can i see this change in your code?


ars123z
TRIALOP

2 years ago

Ofcourse I am sending the link with changed code



ars123z
TRIALOP

2 years ago

Here is the changed code


2 years ago

i dont know what this config thing is, please use env vars, use them for all variables


ars123z
TRIALOP

2 years ago

Ok will try and see


Welcome!

Sign in to your Railway account to join the conversation.

Loading...