Unable to connect neon postgres db from railway

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
23 Replies
Percy
Percy2mo ago
Project ID: eda4e600-d3ed-4224-bb9b-127162c8c0c9
Brody
Brody2mo ago
are you using environment variables? and do you have the needed variables set?
Arsalan Naziri
Arsalan NaziriOP2mo ago
Yes it's set correctly I checked that multiple times
Brody
Brody2mo ago
maybe not, can you show me a screenshot of your variables tab? keep the variables hidden
Arsalan Naziri
Arsalan NaziriOP2mo ago
Here it is
No description
Brody
Brody2mo ago
looks good, show me how you are consuming them in code
Arsalan Naziri
Arsalan NaziriOP2mo ago
Can I share you the GitHub repo
Arsalan Naziri
Arsalan NaziriOP2mo ago
GitHub
GitHub - Ars123z/SaaS-Foundation: Saas Foundation Course
Saas Foundation Course. Contribute to Ars123z/SaaS-Foundation development by creating an account on GitHub.
Arsalan Naziri
Arsalan NaziriOP2mo ago
I have to directly add the parameters to make it work
Arsalan Naziri
Arsalan NaziriOP2mo ago
I changed it just now it's working this way only
Brody
Brody2mo ago
please use environment variables
Arsalan Naziri
Arsalan NaziriOP2mo ago
I am trying but it's just not working
Brody
Brody2mo ago
let me know when you have used environment variables
Arsalan Naziri
Arsalan NaziriOP2mo ago
I think this is a bug railway is not reading the postgres db environment variables correctly
Brody
Brody2mo ago
i'm sorry but that would be incorrect
Arsalan Naziri
Arsalan NaziriOP2mo 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
Brody
Brody2mo ago
can i see this change in your code?
Arsalan Naziri
Arsalan NaziriOP2mo ago
Ofcourse I am sending the link with changed code
Arsalan Naziri
Arsalan NaziriOP2mo ago
GitHub
GitHub - Ars123z/SaaS-Foundation: Saas Foundation Course
Saas Foundation Course. Contribute to Ars123z/SaaS-Foundation development by creating an account on GitHub.
Arsalan Naziri
Arsalan NaziriOP2mo ago
Here is the changed code
Brody
Brody2mo ago
i dont know what this config thing is, please use env vars, use them for all variables
Arsalan Naziri
Arsalan NaziriOP2mo ago
Ok will try and see
Want results from more Discord servers?
Add your server