Skip to content
Remote DB connection (use DATABASE_PUBLIC_URL) returns INTERNAL SERVER ERROR
vkostromin
OP

2 years ago

Can't connect to DB from remote host, return error INTERNAL SERVER ERROR.

I use DATABASE_PUBLIC_URL to connect, it works always and stoped today

$20 Bounty

30 Replies

2 years ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody • over 1 year ago


2 years ago

hey, can you give more information about your code? What are you using to connect to your database?


vkostromin
OP

2 years ago

I use pgAdmin 4


vkostromin
OP

2 years ago

it works last months


2 years ago

I'm looking more on what ORM/library you're using to connect to your database that is giving out INTERNAL SERVER ERRORs


vkostromin
OP

2 years ago

API Server can connect to DB, but I cann't connect to DB


vkostromin
OP

2 years ago

I see this warning today


vkostromin
OP

2 years ago

Api server use nodejs + prisma, it works, Doesn't work remote connection


vkostromin
OP

2 years ago

still not works


vkostromin

Api server use nodejs + prisma, it works, Doesn't work remote connection

2 years ago

Can you please confirm the value of which that variable is set to? Not the actual value, but what variables it's referencing. For example, postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}

Additionally, is there any more information you could get about the error you're getting? It's pretty vague. What are client are you using to connect? Does the viewer built into Railway work?


root101

2 years ago

Couple of things:

1 - The warning about the public URL of the database has always been there. Railway basically recommends always connecting through the internal URL to avoid egress feeds. Additionally, for security reasons, it is good practice to keep the database from being openly exposed to the Internet.

2 - Can you provide a more detail stack trace, logs, or something about the error, so we can look at it in order to find the error

3 - Try the good old restart the service, go to the last deployment, in the 3 dots, click redeploy... and try again


vkostromin
OP

2 years ago

I use variable DATABASE_PUBLIC_URL


vkostromin
OP

2 years ago

it works always but stop today


vkostromin

it works always but stop today

2 years ago

Please read the bullets that @root101 wrote


2 years ago

Also, you just posted your database access URL. I would recommend deleting that. Reset that password immediately.


2 years ago

And do not by any means share your password for it here... even though you already did.


2 years ago

And FYI, I can connect just fine. Something is wrong with whatever you're using to connect, or how you set that up.


root101

2 years ago

@loudbook, i just say i was gonna share it, not worries, i will delete the db soon enough, is just a test


2 years ago

Not you. OP shared their password in an above message.


vkostromin
OP

2 years ago

I've changed password in the link.


vkostromin
OP

2 years ago

I disconnect from server and then connect to server in pgAdmin 4. it works now.

But other container seems has the same problem


vkostromin

I've changed password in the link.

2 years ago

Awesome. Change the password for it too.


2 years ago

Root, do not ask for people's database credentials. vk, it's extremely risky to share credentials with anyone, they're like a password for your database.


2 years ago

I've deleted both URLs from this thread. Please be more careful in the future


root101

2 years ago

hi adam, i just say it was not recommended, just trying to reproduce the error on my end..... i even share a test DB (That bd im deleteing it like now)


root101

hi adam, i just say it was not recommended, just trying to reproduce the error on my end..... i even share a test DB (That bd im deleteing it like now)

2 years ago

It shouldn't have been listed as an option.


adam

It shouldn't have been listed as an option.

root101

2 years ago

okay, noted


vkostromin

I disconnect from server and then connect to server in pgAdmin 4\. it works now. But other container seems has the same problem

2 years ago

Another container within the same project? That's also pgAdmin?


samgordon

Another container within the same project? That's also pgAdmin?

vkostromin
OP

2 years ago

yes, , it is the same group of projects

https://railway.com/project/db6dfaa4-f18d-482d-96fc-bdd31078d43c/service/a2981f82-a255-4466-80c7-b4b405f65854. it is PHP based site. , Seems like connect is stuck too. But remote connect works, I'll work on it tomorrow


vkostromin

I disconnect from server and then connect to server in pgAdmin 4\. it works now. But other container seems has the same problem

root101

2 years ago

as i said in point #3, good old restart all (including conections in pgadmin)


vkostromin

yes, , it is the same group of projects <https://railway.com/project/db6dfaa4-f18d-482d-96fc-bdd31078d43c/service/a2981f82-a255-4466-80c7-b4b405f65854>. it is PHP based site. , Seems like connect is stuck too. But remote connect works, I'll work on it tomorrow

2 years ago

So, is it in the same project? Or in a different project?

That link is not something we can view because your project is private.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...