Closed christroutner closed 3 months ago
Sometimes the libp2p app runs for over an hour without an issue, an other times this Issue occurs within a few seconds after startup. If someone is trying to reproduce this error, restart the app after 5 minutes if the error does not appear. It's a race condition, so it's not easy to reproduce. It appears to involve the connection between two nodes.
In an attempt to debug the root cause, I reverted back to js-libp2p v1.2.1, from the latest v1.3.1. I started to see the same error as above. I realized what had changed is that I was using node.js v20 when I was previously using node.js v16.
I've been doing some testing with js-libp2p v1.3.1 and node.js v16. So far I have not see the error in this Issue.
I'm closing this Issue as I think it's tied to some combination of switching node versions, node_modules, and package-lock.json.
I've successfully gotten the error to go away on node.js v16 on Ubuntu 22. And I've gotten it to run on node.js v20 on Ubutnu 20.
Guys, I'm having the same problem. Nowadays I'm using node 20.11, but in Windows and I tried return to v16 however the problem continues. To be more specific, I'm working with IPFS (helia) and orbitDb, this happens when the terminal reloads, in other words, when the application creates more than one connection (I believe this is the cause of the problem).
If you haven't tried it yet, delete your node_modules
folder and the package-lock.json
file. Then reinstall dependencies with npm install
. That seemed to make a difference for me. It not a silver bullet, but it was definitely one of the factors.
Version: 1.3.1
Platform: Linux pop-os 6.6.6-76060606-generic #202312111032~1702306143~22.04~d28ffec SMP PREEMPT_DYNAMIC Mon D x86_64 x86_64 x86_64 GNU/Linux
Subsystem:
Severity:
Description:
During normal operation of finding and connecting with nodes, the libp2p node will crash. This appears to be due to a race condition. Here is is the error message received from v1.3.1 (latest) version of libp2p:
This is a similar error from an older version of libp2p (v1.2.1):
Steps to reproduce the error:
This error can be reproduced by cloning the helia-coord library, deps-04-24 branch. Install dependencies, then run this javascript file with node.js. After a period of time, the error and crash will occur.