Error: connect ECONNREFUSED
See original GitHub issueHi,
Not sure if this is a bug or unsupported, but I’m seeing the following error:
Error: connect ECONNREFUSED DBX:5342
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
I’m calling pg
on this basis:
const pool = new Pool ({
user: pgUser,
password:pgPass,
database:pgDb,
host:pgHost,
port:pgPort
});
psql -U pgUser -d pgDb -h pgHost -W
works fine and my pg_hba.conf
is correctly configured:
host pgDb pgUser 10.0.0.0/8 md5
So I don’t think its an issue with my postgres setup ?
Node v10.14.1 Postgres 9.6.11 Pg 7.7.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Node.js Error: connect ECONNREFUSED - Stack Overflow
ECONNREFUSED error means that connection could not be made with the target service (in your case localhost:8080 ).
Read more >Error: connect ECONNREFUSED 127.0.0.1:80 - Postman
It looks like you're sending a request to localhost:3000 , but your Proxy settings seem to be set to 127.0.0.1: 8080 Is your...
Read more >How to Fix ECONNREFUSED – connection refused by server ...
One of the possible reasons for this error is that the firewall and anti-virus software on your computer is preventing FileZilla from making...
Read more >Connect ECONNREFUSED 127.0.0.1:27017 in Mongodb ...
Means that NO mongod instance is running at the given host 127.0.0.1 and port 27017. Yes the solution is to start mongod. Mah_Neh:...
Read more >Node.js Error: connect ECONNREFUSED - DEV Community
The solution: · 1. Create an user with password, and grant all provileges. CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If anyone stumbles upon this problem, I use the following wrapper as a workaround:
But I think this is a library’s job.
pg-pool promises to reconnect on connection failures. In the case of
ECONNREFUSED
, it doesn’t fulfil this promise.To me, it feels that adding this functionality directly to the pg module is practical and user-friendly. You can also perhaps call this behavior stable (in the sense “reliable”), which you mentioned as the focus.
Could you please give an example of a situation when this addition is not useful and is harmful in any way?
By default, I think,