Im having trouble connecting my postgres db
Database Connection We are unable to connect to the database over the public network.
Can you connect using this command?
PGPASSWORD=** psql -h viaduct.proxy.rlwy.net -U postgres -p 24399 -d railway
when i run this command I get the following error:
psql: error: connection to server at "viaduct.proxy.rlwy.net" (35.212.103.87), port # failed: server closed the connection unexpectedly
I believe its an issue with how my .env variables are set up - but i can't seem to pin point where they are wrong:
My app references the following:
// Build the PostgreSQL connection string
const dbConnectionString = {
user: process.env.PGUSER '...',
password: process.env.PGPASSWORD '...',
databaseURL: process.env.DATABASE_URL '...',
host: process.env.RAILWAY_TCP_PROXY_DOMAIN '...',
port: process.env.RAILWAY_TCP_PROXY_PORT '...',
database: process.env.PGDATABASE '...',
};
pls help thanks!
20 Replies
Project ID:
7cd5abca-874d-4198-a1a4-2ee775a27807
7cd5abca-874d-4198-a1a4-2ee775a27807
Hello, did you recently migrate v1 -> v2? Is this a new database? Did change regions recently?
This is likely related to the #🚨|incidents we called. The most recent updates will always be on our status page.
After a fix we are back. Can you confrim @matteo ?
This is a new database - i can confirm once the issue is resolved @thomas . Is there any timing on the resolution?
hi @thomas - i just tried again. i received the same error i was receiving earlier which was:
psql: error: connection to server at "viaduct.proxy.rlwy.net" (35.212.103.87), port ** failed: received invalid response to SSL negotiation: H
Any guidance would be much appreaciated
please don't ping team members, instead keep an eye out in #🚨|incidents
We had to re-call the incident
I am sorry for the false hope.
We rolled out a change are monitoring. @matteo
thx - still seeing the same issue "received invalid response to SSL negotiation: H".
Is this the correct channel to get help with my specific issue?
Yes.
So what happened to your database is that you rollout out a node app over your database service.
See the logs here: https://railway.app/project/7cd5abca-874d-4198-a1a4-2ee775a27807/service/bb7e7e72-f90c-4aad-b5ec-732c8e065e7d?id=6f481aeb-af4d-40d3-9123-e9348e784fb0
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Databases V2 are just services. This is to help them integrate more tightly with things like private networking.
Just so I can learn, do you know how this happened? I have never seen someone do this before
It is not related to the issue however.
@matteo in the mean time, you can click the 3 dots on a previous deployment within the postgres service and click redeploy to bring the database back online
I just ran
railway up
from visual code for both postgres and my app
i wonder if it could be an issue with my reference variables -- otherwise perhaps its how my app is configuredyou may have linked to the postgres service instead of your apps service, either way, where you able to do get your database beck online with my instructions?
Nope
did you redeploy an older deployment?
yes i tried and the build failed
postgres doesnt need to build anything, please try with this tool https://bookmarklets.up.railway.app/service-redeploy/
It's working now
yes, but when i deploy my current code to postgres i still get this same issue.
please stop deploying code to the postgres service
you need to be deploying your code to a separate service, please make sure you do not have your cli linked to the postgres service