a year ago
Hello! I'm building an app using neon for my database and railway to deploy but when deploying I get this error.
Database connection error: Error: connect ECONNREFUSED ::1:5432
at /app/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)/app/node_modules/pg-pool/index.js:45
Error.captureStackTrace(err)
^Error: connect ECONNREFUSED ::1:5432
at /app/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getPgVersion (/app/app.js:24:20) {errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 5432
}
Node.js v18.20.2
the database works well on local host. Here's my repo https://github.com/Orion-Barjamaj/Members-Only
ⓘ Deployment information is only viewable by project members and Railway employees.
1 Replies
a year ago
Hello,
Those logs show that your application is trying to connect to a database at localhost and port 5432.
This would be the default connection many Postgres clients will use.
The most common reason for localhost to be used would be that the Postgres client is not correctly configured to connect to a database that is defined via environment variables.