Error: read ECONNRESET
See original GitHub issueHi brianc, this is my first Bug report, so please don’t blame me for bad style:)
I have an issue with loosing connections. This happens after upgrading to node v0.10.1. I used v.8x? before and it worked. I am developing with Windows 8.
Maybe this happens because the Garbage Collector was modified in the new release? I wrote a simple mocha test that shows the problem. var pg = require(‘pg’);
describe('pg', function(){
this.timeout(65000);
describe('connection', function() {
it("should throw no error for 1 min", function(testDone) {
pg.on("error", function(e){
//"Error: read ECONNRESET" is thrown for me after 30sec
testDone(e)
});
pg.connect("tcp://postgres:1234@localhost/postgres", function(err, client, done){
client.query("select 'something'", function(err, result){
done();
if (err) return testDone (err);
setTimeout(function(){
testDone();
}, 60000);
});
})
});
});
})
Debugging this lead me to the assumption, that it is caused by the garbage collector, that is trying to destroy the tcp socket used by the database, but maybe I am completly wrong with this.
Issue Analytics
- State:
- Created 10 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
How do I debug error ECONNRESET in Node.js?
ECONNRESET occurs when the server side closes the TCP connection and your request to the server is not fulfilled. The server ...
Read more >What does “Error: read ECONNRESET” mean? - Quora
It means that your application dropped it's TCP connection. For example, if you lost your wifi signal while running your app you would...
Read more >How do I debug error ECONNRESET in Node.js?
“ECONNRESET” means the other side of the TCP conversation abruptly closed its end of the connection. This is most probably due to one...
Read more >Absolutely baffled why I am getting Error: read ECONNRESET ...
Error: read ECONNRESET is a problem in Node.js. There seesm to be something wrong yout TCP connection setup. Can you share a code...
Read more >read ECONNRESET error while using Postman f... - DevCentral
Error is below: TCL error: /Common/irule_172.29.8.1 - can't use ... Error: read ECONNRESET error while using Postman for API calls after change to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
I still get this error when trying to connect in Windows 7 x64.
here’s the log:
Hello boys brian forum and apologize for the inconvenience … primaremante tell but a month I’m using the “pg” package ago, I worked well … hize as stated in the documentation building a pool and applying it in the constructor configurations for connection to postgres; but then I got an error -> ECONNRESET on the console when attempting to connect to postgres and a consultation; now I am using Windows 10 x64, postgreSQL 9.5 and node v4.6.0, I would greatly appreciate some clarification’m going with this two weeks without finding answers.
This is the error console.
error fetching client from pool identificasion { [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
This is the code and the connection:
_bd.js_***
`var pg=require(‘pg’);
*****************************_index.js_
` var express = require(‘express’); var router = express.Router();//declarando un objeto router para ser mandado a la app var session= require(‘express-session’); var pg=require(‘pg’); var bd=require(‘…/bd.js’); var pool=bd.basedatos;
router.post(‘/Usuario/identificasion’, function(req, res, next) {//aui se le asigna las rutas console.log(req.body.xlogin,‘tb’,req.body.xpassword); pool.connect(function(err, client, done) { if(err) { return console.error(‘error fetching client from pool identificasion’, err); } client.query('SELECT * FROM DATOS WHERE(login=$1 and password=$2 and estado=1) ', [req.body.xlogin,req.body.xpassword],function(err,result){ done(); if(err) { return console.error(‘Error de ejecución de consulta’, err); } var JsonR= new Object(); JsonR.status=“resp”; JsonR.valor=true; // res.json(result.rows) console.log(JsonR); res.json(JsonR)
// res.render(‘ModalLogueo’); });`