Postgres Migration Connection Issue
I just migrated my postgres db but I'm unable to connect and I get the following error
could not receive data from client: Connection reset by peer
.
Not sure what's going on, but when I connect my server to the legacy postgres db it works just fine.
The migration looks like it finished. I've tried re-deploying the new Postgres db, but still no luck.
projectId: 6e514526-cb71-44b4-824d-f7ff0a10f9051
15 Replies
Project ID:
6e514526-cb71-44b4-824d-f7ff0a10f905
Same here
Full error logs for me (all these lines are in red):
2023-11-29 08:40:09.244 UTC [7] LOG: starting PostgreSQL 15.4 (Ubuntu 15.4-2.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
2023-11-29 08:40:09.244 UTC [7] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-11-29 08:40:09.244 UTC [7] LOG: listening on IPv6 address "::", port 5432
2023-11-29 08:40:09.248 UTC [7] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-11-29 08:40:09.255 UTC [34] LOG: database system was interrupted; last known up at 2023-11-29 08:31:29 UTC
2023-11-29 08:40:09.295 UTC [34] LOG: database system was not properly shut down; automatic recovery in progress
2023-11-29 08:40:09.299 UTC [34] LOG: redo starts at 0/283F538
2023-11-29 08:40:09.299 UTC [34] LOG: invalid record length at 0/283F570: wanted 24, got 0
2023-11-29 08:40:09.299 UTC [34] LOG: redo done at 0/283F538 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2023-11-29 08:40:09.304 UTC [32] LOG: checkpoint starting: end-of-recovery immediate wait
2023-11-29 08:40:09.315 UTC [32] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.013 s; sync files=2, longest=0.002 s, average=0.001 s; distance=0 kB, estimate=0 kB
2023-11-29 08:40:09.323 UTC [7] LOG: database system is ready to accept connections
2023-11-29 08:40:09.328 UTC [37] LOG: TimescaleDB background worker launcher connected to shared catalogs
Yeah my log trace is the same as @Raigato
@Brody any updates on this?
Thread has been flagged to Railway team by @Brody.
Red postgres logs aren't actually errors. Postgres emits to both stdout and stderr for different types of log messages (not necessarily errors)
It looks like everything is working in your project. Are you still seeing issues?
Yes still having issues. It's giving me a different error now then before but essentially my prisma client can't seem to connect to the postgres database.
I set the environment variables for my server as as
${{Postgres.DATABASE_URL}}
Yes I'm still having issues. My server is unable to connect to the database. I've set the environment variable for my server for the database as ${{Postgres.Database_URL}}
Here's the logs
Ah, got it. So it looks like you may have run into the incident we had this morning. I issued a redeploy of your service and it seems to have connected this time https://status.railway.app
Hmm strange... I tried redploying and in the server logs I get this now
No other db errors showing int he logs.
However when I try my local server on my machine and connecting to the postgres db on railway it seems to work just fine. Could it be an issue with server connection on railway?
Service id for the server is
45bdfe3c-df2c-4cc2-aff6-806004775564
Want to create a new help thread for this? It seems like it's an application-related issue, though it's strange that it doesn't happen locally
Oh, I just noticed you're still using buildpacks. It may help to switch to Nixpacks under the build settings for that service
We no longer support Heroku Buildpacks as an environment
Ah I see, that would make sense. Sure let me try that and if it still doesn't work I'll start a new help thread. Thanks Greg 🙏
No problem 🙂
Looks like it's all working now. Thanks Greg. Just had to change to Nixpacks and redploy 🙌
Woot! 👍