Connection.end() causes an emit of ECONNRESET
See original GitHub issueWhen I run some of the tests, e.g
node test/test-basic-return.js
I get
/home/ch/node_modules/amqp/node_modules/longjohn/dist/longjohn.js:184
throw e;
^
Error: read ECONNRESET
at errnoException (net.js:901:11)
at onread (net.js:556:19)
---------------------------------------------
at module.exports.run (/home/ch/node_modules/amqp/test/harness.js:49:23)
at Object.<anonymous> (/home/ch/node_modules/amqp/test/test-basic-return.js:1:84)
at Module._compile (module.js:456:26)
at Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Module._load (module.js:312:12)
at Module.runMain (module.js:497:10)
at startup (node.js:119:16)
It seems it is connected to #295 and #246, however the code from #248 does not solve it.
It is a hell of a bug, because it caused me to look for a few hours for a bug in exchange.publish, and then it turned out it is some networking stuff happening upon connection.end().
Issue Analytics
- State:
- Created 10 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
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 >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 >Errors | Node.js v19.3.0 Documentation
ECONNRESET (Connection reset by peer): A connection was forcibly closed by a peer. This normally results from a loss of the connection on...
Read more >node:events:505 throw er; / unhandled 'error' event ^ error
"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 >15 Common Error Codes in Node.js and How to Fix Them
1. ECONNRESET ... If this exception occurs when making a request to another server, you should catch it and decide how to handle...
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 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

My branch doesn’t stop other bits of the system from trying to send data once the socket is closed - I was a bit lazy there.
Say you have a continuous publish(), then you trigger a close - the publish that happens after socket.end() / connectionCloseOk will cause the exception described above.
Possible Solutions:
test/test-basic-return.js: Error: read ECONNRESET at TCP.onread (net.js:660:25)
Facing above issue in debian, nodejs v10.8 and RabbitMQ 3.3.5. Downloaded the current commit and connection.js file has destroy function called. case methods.connectionCloseOk: debug && debug(“Received close-ok from server, closing socket”); this.socket.end(); this.socket.destroy(); break;
Please suggest me any other solution. Thanks.