Node js deployment issues

‘Error: listen EACCES: permission denied postgres’
I think this might have to do with JWT? How could add a JWT to the deployment?

This error usually indicates write error to a filesystem. What is your setup? Can you share something more? Logs? Code? Build and start commands?

JWT is not related to the deployment, it’s authentication system implemented in your code. Service A would send a http request, with an authorization header containing the JWT. Service B would get that request and check if JWT token is valid and then do what the request is asking.

So adding it to deployment doesn’t really fit, it’s just done with your code.

Dec 20 07:59:04 AM BEGINNING SEEDING…
Dec 20 07:59:04 AM /opt/render/project/src/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:130
Dec 20 07:59:04 AM reject(new sequelizeErrors.ConnectionRefusedError(err));
Dec 20 07:59:04 AM ^
Dec 20 07:59:04 AM
Dec 20 07:59:04 AM ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 127.0.0.1:5432
Dec 20 07:59:04 AM at Client._connectionCallback (/opt/render/project/src/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:130:24)
Dec 20 07:59:04 AM at Client._handleErrorWhileConnecting (/opt/render/project/src/node_modules/pg/lib/client.js:305:19)
Dec 20 07:59:04 AM at Client._handleErrorEvent (/opt/render/project/src/node_modules/pg/lib/client.js:315:19)
Dec 20 07:59:04 AM at Connection.emit (node:events:513:28)
Dec 20 07:59:04 AM at Socket.reportStreamError (/opt/render/project/src/node_modules/pg/lib/connection.js:52:12)
Dec 20 07:59:04 AM at Socket.emit (node:events:513:28)
Dec 20 07:59:04 AM at emitErrorNT (node:internal/streams/destroy:157:8)
Dec 20 07:59:04 AM at emitErrorCloseNT (node:internal/streams/destroy:122:3)
Dec 20 07:59:04 AM at processTicksAndRejections (node:internal/process/task_queues:83:21) {
Dec 20 07:59:04 AM parent: Error: connect ECONNREFUSED 127.0.0.1:5432
Dec 20 07:59:04 AM at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1247:16) {
Dec 20 07:59:04 AM errno: -111,
Dec 20 07:59:04 AM code: ‘ECONNREFUSED’,
Dec 20 07:59:04 AM syscall: ‘connect’,
Dec 20 07:59:04 AM address: ‘127.0.0.1’,
Dec 20 07:59:04 AM port: 5432
Dec 20 07:59:04 AM },
Dec 20 07:59:04 AM original: Error: connect ECONNREFUSED 127.0.0.1:5432
Dec 20 07:59:04 AM at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1247:16) {
Dec 20 07:59:04 AM errno: -111,
Dec 20 07:59:04 AM code: ‘ECONNREFUSED’,
Dec 20 07:59:04 AM syscall: ‘connect’,
Dec 20 07:59:04 AM address: ‘127.0.0.1’,
Dec 20 07:59:04 AM port: 5432
Dec 20 07:59:04 AM }
Dec 20 07:59:04 AM }

I only got the previous error once now im getting this. Im using Node, postgresql and sequelize

Thanks. How are you connecting sequilize to your postgres db?

I have never used Sequalized but that ip indicates sequalize is trying to connect to a localhost db.

You can check out this thread: Nodejs express postgres application failing on deployment - #5 by al_ps

Hey,

server/db/seed.js is trying to connect to a database located at 127.0.0.1:5432. Your SQL database is not running at this address, therefore, throwing this error message.

In your latest deploys, I can see some errors about the build script. Make sure that they’re correct and working locally before deploying to Render.

Jérémy, Render Support

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.