js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

Uncaught ECONNRESET somewhere in our code base

Open TimDaub opened this issue 1 year ago • 1 comments

Hi,

a node operator on Kiwi News always reports the following error:

2024-10-02 10 45 21

We don't know where this is coming from, but we think it is libp2p. Before opening an issue, I asked in the libp2p TG if someone could help us find the cause of this, but it was suggested that I open an issue: https://t.me/c/2109810685/11/818

  • Version: We use libp2p v0.40.0 https://github.com/attestate/kiwistand/blob/41aa70347eb8786f1cefa6746aa700a563c053c1/package.json#L83 we don't really have budget to upgrade this ATM

  • Platform: Ubuntu

  • Subsystem: I'm not sure. But we use a variety of libp2p packages where this could originate from, see this part of the package.json: https://github.com/attestate/kiwistand/blob/41aa70347eb8786f1cefa6746aa700a563c053c1/package.json#L47-L55

Severity: Critical because it makes our application panic

Description: This happens once two nodes are connected and exchanging messages. If one of the nodes unexpectedly crashes or gets terminated, then the other one will throw this error. I have checked most/all interactions I have with libp2p methods to make sure I'm try catching everything, but I haven't managed to find where this error is coming from. And also: the error doesn't have a stack trace, so I'm also unsure how I'd anyways find out more.

Steps to reproduce the error: Run two Kiwi News nodes, wait until they start the set reconciliation. Kill one node with Ctrl - C. Most likely the other will throw the ECONNRESET.

TimDaub avatar Oct 02 '24 08:10 TimDaub

Version 0.40.0 of js-libp2p is around 2 years old. Since then there have been some significant changes and fixes to js-libp2p including some fixed memory leaks.

One thing you could try is enabling more verbose logging from libp2p by setting the DEBUG env var to *,*:debug to get everything and then narrow down.

2color avatar Oct 17 '24 11:10 2color

I would strongly advise upgrading to the latest libp2p, we simply do not have the capacity to support older versions.

There are detailed migration guides to make this as painless as possible.

The TCP transport has had several changes made to it in recent releases which make it more resilient, improves error handling and fixes a number of memory leaks.

Please upgrade and report back if this is still happening.

achingbrain avatar Oct 23 '24 07:10 achingbrain

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

github-actions[bot] avatar Oct 30 '24 00:10 github-actions[bot]

This issue was closed because it is missing author input.

github-actions[bot] avatar Nov 07 '24 00:11 github-actions[bot]