4 months ago
I’m encountering a persistent database connection error when running: npx prisma migrate reset
Error: P1001: Can't reach database server at switchback.proxy.rlwy.net:23412
This occurs even after:
Verifying that
.envhas the correctDATABASE_URLWaking up the project from the Railway dashboard
Confirming that other Prisma commands like
generatework fine
I have no open connections, and I’ve deleted the Agent table contents to avoid foreign key conflicts.
Run
npx prisma migrate resetSee error:
Can't reach database server at switchback.proxy.rlwy.net:23412
Database: Railway PostgreSQLPrisma CLI Version: 6.11.0
Project:
getmyagentnow-ui
Can you confirm whether the DB proxy (switchback.proxy.rlwy.net:23412) is healthy and accepting connections?
Is there anything I can do to reinitialize or reauthorize access?
6 Replies
4 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 Railway Support Request - Internal Database Connection Failure
🧵 Unable to Connect to PostgreSQL Database via Prisma (P1001 Error) In R-ECREATE Next JS App
If you find the answer from one of these, please let us know by solving the thread!
4 months ago
Are you sure that the DB service is active, when the calls are being made? Sometimes, it goes into the sleep state after few minutes of inactivity.
Add a longer connection timeout to your DATABASE_URL by appending ?connect_timeout=10 (or higher) to allow more time for wake-up delays.
DATABASE_URL=postgresql://user:pass@switchback.proxy.rlwy.net:23412/dbname?connect_timeout=10
clashing
Are you sure that the DB service is active, when the calls are being made? Sometimes, it goes into the sleep state after few minutes of inactivity. Add a longer connection timeout to your DATABASE_URL by appending ?connect_timeout=10 (or higher) to allow more time for wake-up delays.DATABASE_URL=postgresql://user:pass@switchback.proxy.rlwy.net:23412/dbname?connect_timeout=10
4 months ago
Any update, gman?
4 months ago
no , this didnt work
Railway
Hey there! We've found the following might help you get unblocked faster: - [🧵 Railway Support Request - Internal Database Connection Failure](https://station.railway.com/questions/railway-support-request-internal-datab-189b50d8) - [🧵 Unable to Connect to PostgreSQL Database via Prisma (P1001 Error) In R-ECREATE Next JS App](https://station.railway.com/questions/unable-to-connect-to-postgre-sql-database-960d5d0e) - [🧵 NEED HELP NOW](https://station.railway.com/questions/need-help-now-7dd9ee44) If you find the answer from one of these, please let us know by solving the thread!
4 months ago
Hi Railway Team – same issue here.
Host: switchback.proxy.rlwy.net:23412
Postgres logs say “ready to accept connections,” but Prisma throws P1001, and nc gets no response.
This is blocking our production deploy. Can someone restart the proxy or investigate?
Thanks.
11 days ago
I'm having the same exact problem.