N
Neon2y ago
ratty-blush

Sequelize and Neon ECONNREFUSED

Hi ! I am working on a Node.js project with Sequelize as the ORM. When I start my project locally on my machine, I am able to connect to the Neon database. However, on the production version of my app, I encounter an error: {"status":"error","statusCode":500,"message":"Error: connect ECONNREFUSED 3.126.212.11:5432"} I deployed my backend on O2 Switch and also and a Ni Host VPS, I can connect to the dtabase from the app hosted on VPS but impossible from O2 Switch. Of course My client need to use the one is on O2 Switch 😦 Thank you 🙂
7 Replies
adverse-sapphire
adverse-sapphire2y ago
The fact that the connection from your dev machine and VPS are successful but the connection from the switch fails is odd. Is something sitting between the switch and AWS? I was able to verify the host/port from my local machine using:
> nc -z -v -w5 3.126.212.11 5432
Connection to 3.126.212.11 port 5432 [tcp/postgresql] succeeded!
> nc -z -v -w5 3.126.212.11 5432
Connection to 3.126.212.11 port 5432 [tcp/postgresql] succeeded!
ratty-blush
ratty-blushOP2y ago
I can't use this commande on O2 Switch terminal : nc is not found O2 Switch support says the issue come from the port 5432. Is not opened on O2 Switch server. But it's a strange answer
adverse-sapphire
adverse-sapphire2y ago
Sounds like you need to configure the switch to open that port then? The O2 Switch support should be able to provide those instructions.
ratty-blush
ratty-blushOP2y ago
They replied that since it's shared hosting, they can't open specific ports. On the Neon side, isn't there a way to use a port other than 5432 in order to use an open port on the O2 Switch server?
adverse-sapphire
adverse-sapphire2y ago
I’ll ask our product team. In the meantime, can you communicate over standard HTTP/HTTPS ports. I believe our serverless driver works that way. Otherwise I think you might need to setup a proxy of some sort.
ratty-blush
ratty-blushOP2y ago
Yes, I can communicate with the server via http / https without any problems. According to O2 Switch, it is not possible for them to open new ports as this is shared hosting.
adverse-sapphire
adverse-sapphire2y ago
That's unfortunate. Sounds like the serverless driver is your best bet then, or setting up a proxy of some sort that allows you to use an open port.

Did you find this page helpful?