How do I debug error ECONNRESET in Node.js?

后端 未结 14 1457
刺人心
刺人心 2020-11-22 04:02

I\'m running an Express.js application using Socket.io for a chat webapp and I get the following error randomly around 5 times during 24h. The node process is wrapped in for

14条回答
  •  甜味超标
    2020-11-22 04:32

    I had this Error too and was able to solve it after days of debugging and analysis:

    my solution

    For me VirtualBox (for Docker) was the Problem. I had Port Forwarding configured on my VM and the error only occured on the forwarded port.

    general conclusions

    The following observations may save you days of work I had to invest:

    • For me the problem only occurred on connections from localhost to localhost on one port. -> check changing any of these constants solves the problem.
    • For me the problem only occurred on my machine -> let someone else try it.
    • For me the problem only occurred after a while and couldn't be reproduced reliably
    • My Problem couldn't be inspected with any of nodes or expresses (debug-)tools. -> don't waste time on this

    -> figure out if something is messing around with your network (-settings), like VMs, Firewalls etc., this is probably the cause of the problem.

提交回复
热议问题