Local Validator Node error (libra_swarm/src/swarm.rs:278:9)

Hi, I am getting the following error while starting my local validator node:

Error:
Finished dev [unoptimized + debuginfo] target(s) in 3m 24s Runningtarget/debug/libra_swarm -sFaucet account created in (loaded from) file "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/keypair.omHcqIKXBRC2/temp_faucet_keys" Base directory containing logs and configs: Temporary(TempDir { path: "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/.tmpMZf1Kx" }) Base directory containing logs and configs: Temporary(TempDir { path: "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/.tmpfm7Eaf" }) Base directory containing logs and configs: Temporary(TempDir { path: "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/.tmpZYJT0E" }) Base directory containing logs and configs: Temporary(TempDir { path: "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/.tmpK5Xklg" }) Base directory containing logs and configs: Temporary(TempDir { path: "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/.tmpCbxD1e" }) thread 'main' panicked at 'Max out 5 attempts to launch swarm', libra_swarm/src/swarm.rs:278:9 note: run withRUST_BACKTRACE=1environment variable to display a backtrace.

Stacktrace:
stack backtrace: 0: std::sys_common::backtrace::Printer::output 1: std::sys_common::bytestring::debug_fmt_bytestring at src/libstd/sys_common/bytestring.rs:16 2: <std::sys_common::os_str_bytes::Slice as core::fmt::Debug>::fmt at src/libstd/sys_common/os_str_bytes.rs:27 3: std::sys_common::fs::remove_dir_all_recursive at src/libstd/sys_common/fs.rs:32 4: core::option::Option<T>::unwrap at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/macros.rs:12 5: std::sys_common::thread_info::ThreadInfo::with::{{closure}} at src/libstd/sys_common/thread_info.rs:23 6: std::sys_common::thread_info::ThreadInfo::with::{{closure}} at src/libstd/sys_common/thread_info.rs:18 7: std::io::Read::read_exact at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libstd/io/mod.rs:763 8: <unknown> 9: core::ptr::real_drop_in_place at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/ptr/mod.rs:175 10: core::option::Option<T>::and_then at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/option.rs:624 11: std::sys_common::thread::min_stack at src/libstd/sys_common/thread.rs:22 12: std::sys::unix::process::process_inner::<impl std::sys::unix::process::process_common::Command>::do_exec at src/libstd/sys/unix/process/process_unix.rs:257 13: std::sync::once::Once::call_once at src/libstd/sync/once.rs:225 14: std::sys_common::cleanup at src/libstd/sys_common/mod.rs:123 15: core::ptr::real_drop_in_place at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/ptr/mod.rs:175 16: <core::result::Result<T,E> as core::ops::try::Try>::from_error at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/result.rs:1313

I am on mac.
I downloaded a fresh version from the repo.
Executed: ./scripts/dev_setup.sh
Then cargo run -p libra_swarm -- -s

BTW - I have another folder with another fresh version (https://github.com/libra/libra.git) that I used to connect my node to testnet and it worked fine.

Any idea what could be wrong here?

Thanks!!

Hi @Juan-cc,

The code was changing everyday, sometime developer(s) and merger(s) are still working on push series of improvement/fix which during that period you might clone/checkout the code to execute.

I would suggest to clone/checkout the latest libra and if you still found error I think I can help to take a look.

BTW, I’m executing local testnet with latest libra so far no error found.

Another reasson I can think of is you face out of memory, try not open many application while running local testnet might help.

Hi!

In general, it would be helpful if you specify the revision you’re running “a fresh version from the repo” is not specific enough.

Specifically for libra_swarm startup issues, the most useful thing would be to start it with -c option, that uses an existing folder for config and logs, instead of a temp folder. Then, when it fails, check the logs from that folder or paste them here to get a better idea about what was the failure for the nodes.

$ mkdir swarm_dir
$ cargo run -p libra_swarm -- -s -c swarm_dir

Hi guys, thanks for your answers.
The specific version I am using is


I also executed with -c but without any luck:

 cargo run -p libra_swarm -- -s -c ./juanswarm


Finished dev [unoptimized + debuginfo] target(s) in 0.46s
 Running `target/debug/libra_swarm -s -c ./juanswarm`
Faucet account created in (loaded from) file "/var/folders/1r/yjfqkjdx74n_1y3ct2kk12f00000gn/T/keypair.jSBwJzE2PyDQ/temp_faucet_keys"
Base directory containing logs and configs: Persistent("./juanswarm")
Base directory containing logs and configs: Persistent("./juanswarm")
Base directory containing logs and configs: Persistent("./juanswarm")
Base directory containing logs and configs: Persistent("./juanswarm")
Base directory containing logs and configs: Persistent("./juanswarm")
thread 'main' panicked at 'Max out 5 attempts to launch swarm', libra_swarm/src/swarm.rs:278:9
stack backtrace:
   0: std::sys_common::backtrace::Printer::output
   1: std::sys_common::bytestring::debug_fmt_bytestring
             at src/libstd/sys_common/bytestring.rs:16
   2: <std::sys_common::os_str_bytes::Slice as core::fmt::Debug>::fmt
             at src/libstd/sys_common/os_str_bytes.rs:27
   3: std::sys_common::fs::remove_dir_all_recursive
             at src/libstd/sys_common/fs.rs:32
   4: core::option::Option<T>::unwrap
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/macros.rs:12
   5: std::sys_common::thread_info::ThreadInfo::with::{{closure}}
             at src/libstd/sys_common/thread_info.rs:23
   6: std::sys_common::thread_info::ThreadInfo::with::{{closure}}
             at src/libstd/sys_common/thread_info.rs:18
   7: std::io::Read::read_exact
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libstd/io/mod.rs:763
   8: <unknown>
   9: core::ptr::real_drop_in_place
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/ptr/mod.rs:175
  10: core::option::Option<T>::and_then
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/option.rs:624
  11: std::sys_common::thread::min_stack
             at src/libstd/sys_common/thread.rs:22
  12: std::sys::unix::process::process_inner::<impl std::sys::unix::process::process_common::Command>::do_exec
             at src/libstd/sys/unix/process/process_unix.rs:257
  13: std::sync::once::Once::call_once
             at src/libstd/sync/once.rs:225
  14: std::sys_common::cleanup
             at src/libstd/sys_common/mod.rs:123
  15: core::ptr::real_drop_in_place
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/ptr/mod.rs:175
  16: <core::result::Result<T,E> as core::ops::try::Try>::from_error
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/result.rs:1313

Hi @apisak, thanks for your answer.

I am executing latest code. And I am also running a local node against Testnet without issues, the problem happens when I try to start a local validator node without Testnet.

1 Like

I just found the fix. This error was related with the number of descriptors. Checking the logs in ./juanswarm/logs/8de…fb9f.log I found the real issue was “Too many open files”.

So I followed these steps and it’s working now:

  • check number of open descriptors
    ulimit -a
  • changing max number of open descriptors
    ulimit -n 4096

Fix source: https://github.com/libra/libra/issues/81

Thanks @apisak @bandersnatch for your help guys! Let’s keep up buidling dApps

1 Like

Nice ! Have fun with Libra :slight_smile: