fluencelabs/nox

LibP2P Protocol: unexpected EOF when reading incoming ProtocolMessage

Closed this issue · 1 comments

folex commented

After updating to the latest libp2p, exceptions started to appear in logs:

[2022-03-22T13:55:36.259798Z WARN  particle_protocol::libp2p_protocol::upgrade] Error processing inbound ProtocolMessage: unexpected end of file

    Location:
        /__w/fluence/fluence/particle-protocol/src/libp2p_protocol/upgrade.rs:126:30

    Stack backtrace:
       0: core::ops::function::Fn::call
       1: eyre::capture_handler
       2: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       3: <libp2p_core::either::EitherFuture2<AFut,BFut> as core::future::future::Future>::poll
       4: futures_util::future::future::FutureExt::poll_unpin
       5: <libp2p_swarm::protocols_handler::node_handler::NodeHandlerWrapper<TProtoHandler> as libp2p_core::connection::handler::ConnectionHandler>::poll
       6: libp2p_core::connection::Connection<TMuxer,THandler>::poll
       7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       8: futures_executor::thread_pool::PoolState::work
       9: std::sys_common::backtrace::__rust_begin_short_backtrace
      10: core::ops::function::FnOnce::call_once{{vtable.shim}}
      11: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                 at ./rustc/ec4bcaac450279b029f3480b8b8f1b82ab36a5eb/library/alloc/src/boxed.rs:1854:9
      12: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                 at ./rustc/ec4bcaac450279b029f3480b8b8f1b82ab36a5eb/library/alloc/src/boxed.rs:1854:9
      13: std::sys::unix::thread::Thread::new::thread_start
                 at ./rustc/ec4bcaac450279b029f3480b8b8f1b82ab36a5eb/library/std/src/sys/unix/thread.rs:108:17
      14: start_thread
      15: clone

[2022-03-22T13:55:36.260040Z WARN  particle_protocol::libp2p_protocol::upgrade] Error sending ProtocolMessage: Custom { kind: WriteZero, error: "e4278881/14: connection is closed" }
[2022-03-22T13:55:37.536056Z WARN  particle_protocol::libp2p_protocol::upgrade] Error processing inbound ProtocolMessage: unexpected end of file

Probably, the channel closing procedure is implemented incorrectly. Need to investigate that.

It appears that you are seeing error messages in your logs related to the processing of inbound ProtocolMessages and the sending of ProtocolMessages in the particle-protocol library. The errors include "unexpected end of file" and "connection is closed".

These errors can occur when there is a problem with the communication between two nodes on the network. It is possible that the nodes are not properly handling the closing of channels or connections, which can lead to errors like these.

To troubleshoot these errors, you may want to start by checking the code that is responsible for closing channels and connections to see if there are any issues or bugs that could be causing the errors. You may also want to check the configuration of your nodes and the network as a whole to see if there are any issues there that could be contributing to the problems.

It is also possible that the errors are being caused by issues outside of your control, such as network outages or problems with other nodes on the network. In this case, you may need to work with the other nodes or your network administrator to resolve the issues.

Without more information about your specific setup and the steps you have taken to troubleshoot the errors, it is difficult to provide more specific guidance on how to resolve the issues you are experiencing. However, I hope that the general suggestions I have provided will be helpful as you work to resolve the errors in your logs.