R
Railway11mo ago
Raigato

postgres could not receive data from client

I tried migrating one of my postgres database but keep getting "could not receive data from client: Connection reset by peer" errors when trying to reach it through an express server. Same behaviour with newly created Postgres database service.
Solution:
Sure, I added ?connect_timeout=30&pool_timeout=30&socket_timeout=30 at the end of the DATABASE_URL (initialy for migrations). Also, the issue seemed to come from an old Prisma package version which was triggering Segmentation fault errors. Updating it to latest solved the problem 🙌...
Jump to solution
6 Replies
Percy
Percy11mo ago
Project ID: ca07cd9d-fb81-4dce-ad1b-161d8d544c3e
Raigato
RaigatoOP11mo ago
ca07cd9d-fb81-4dce-ad1b-161d8d544c3e The postgres service logs
Raigato
RaigatoOP11mo ago
Raigato
RaigatoOP11mo ago
The express server service logs Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database "railway", schema "public" at "monorail.proxy.rlwy.net:24083" 5 migrations found in prisma/migrations Applying migration 20230327113536_add_auth_models Applying migration 20230327142924_cascade_delete_on_permission Applying migration 20230328083422_add_review_module Applying migration 20230331131732_init Applying migration 20231128084840_add_scores_module The following migrations have been applied: migrations/ └─ 20230327113536_add_auth_models/ └─ migration.sql └─ 20230327142924_cascade_delete_on_permission/ └─ migration.sql └─ 20230328083422_add_review_module/ └─ migration.sql └─ 20230331131732_init/ └─ migration.sql └─ 20231128084840_add_scores_module/ └─ migration.sql All migrations have been successfully applied. npm notice npm notice New major version of npm available! 9.5.0 -> 10.2.5 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>; npm notice Run npm install -g [email protected] to update! npm notice Server listening on port 7597 request completed Segmentation fault Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database "railway", schema "public" at "monorail.proxy.rlwy.net:24083" 5 migrations found in prisma/migrations No pending migrations to apply. ┌─────────────────────────────────────────────────────────┐ │ Update available 4.1.1 -> 5.7.1 │ │ │ │ This is a major update - please follow the guide at │ │ https://pris.ly/d/major-version-upgrade │ │ │ │ Run the following to update │ │ npm i --save-dev prisma@latest │ │ npm i @prisma/client@latest │ └─────────────────────────────────────────────────────────┘ Server listening on port 7597
Brody
Brody11mo ago
could you try adding a 3 second sleep to your start command?
Solution
Raigato
Raigato11mo ago
Sure, I added ?connect_timeout=30&pool_timeout=30&socket_timeout=30 at the end of the DATABASE_URL (initialy for migrations). Also, the issue seemed to come from an old Prisma package version which was triggering Segmentation fault errors. Updating it to latest solved the problem 🙌
Want results from more Discord servers?
Add your server