Issue with running a safe ipv4 join node inside a podman container

Alright, so this works…

root node on host

sn_node -vv --idle-timeout-msec 5500 --keep-alive-interval-msec 4000 --skip-igd --local-addr 192.168.178.29:12000 --public-addr 192.168.178.29:12000 --first &

join node on host

RUST_LOG=safe_network=info,qp2p=info ~/.safe/node/sn_node --skip-igd --local-addr 192.168.178.29:12001 --public-addr 192.168.178.29:12001 --root-dir ~/.safe/node/joinnode-ipv4_1 &
...
	 ➤ cd92b0.. Joined the network!

But this doesn’t.

root node on host

sn_node -vv --idle-timeout-msec 5500 --keep-alive-interval-msec 4000 --skip-igd --local-addr 192.168.178.29:12000 --public-addr 192.168.178.29:12000 --first &

Dockerfile entrypoint command

safe networks switch local-ipv4 && RUST_LOG=safe_network=info,qp2p=info ~/.safe/node/sn_node --skip-igd --local-addr $JOINNODE_IP:$JOINNODE_PORT --public-addr $JOINNODE_IP:$JOINNODE_PORT

join node in container

$ podman ps -a
CONTAINER ID  IMAGE                                COMMAND     CREATED         STATUS                     PORTS                                                             NAMES
c928c540791d  localhost/joinnode-ipv4_test:latest              51 seconds ago  Up Less than a second ago  192.168.178.29:12001->12001/tcp, 192.168.178.29:12001->12001/udp  joinnode-ipv4_1

log of join node

Switching to 'lan-ipv4' network...
Fetching 'lan-ipv4' network connection information from '/home/admin/.safe/cli/networks/lan-ipv4_node_connection_info.config' ...
Successfully switched to 'lan-ipv4' network in your system!
If you need write access to the 'lan-ipv4' network, you'll need to restart authd (safe auth restart), unlock a Safe and re-authorise the CLI again
Starting logging to stdout
 INFO 2021-11-29T13:41:10.010399Z [sn/src/routing/routing_api/mod.rs:L152]:
	 ➤ 14b667.. Bootstrapping a new node.
Error:
   0: Cannot start node (log path: unknown). If this is the first node on the network pass the local address to be used using --first

   1: Routing error:: Cannot connect to the endpoint: Failed to bind UDP socket
   2: Cannot connect to the endpoint: Failed to bind UDP socket
   3: Failed to bind UDP socket
   4:
Address not available (os error 99)

Location:
   sn/src/bin/sn_node.rs:216

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

With RUST_BACKTRACE=full

$ podman logs joinnode-ipv4_1
Switching to 'lan-ipv4' network...
Fetching 'lan-ipv4' network connection information from '/home/admin/.safe/cli/networks/lan-ipv4_node_connection_info.config' ...
Successfully switched to 'lan-ipv4' network in your system!
If you need write access to the 'lan-ipv4' network, you'll need to restart authd (safe auth restart), unlock a Safe and re-authorise the CLI again
Starting logging to stdout
Error:
   0: Cannot start node (log path: unknown). If this is the first node on the network pass the local address to be used using --first

   1: Routing error:: Cannot connect to the endpoint: Failed to bind UDP socket
   2: Cannot connect to the endpoint: Failed to bind UDP socket
   3: Failed to bind UDP socket
   4:
Address not available (os error 99)

Location:
   sn/src/bin/sn_node.rs:216

  ━━━
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE
━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━
━━━━



         ⋮ 2 frames hidden ⋮



   3: sn_node::run_node::{{closure}}
::hd0d551967e67d64b
      at <unknown source file>:<unknown line>

4: tokio::park::thread::CachedParkThread::block_on::hd1e8a69fe8e8e6ef
      at <unknown source file>:<unknown line>

   5: tokio::runtime::thread_pool::ThreadPool::block_on::h789618e5468c332c
      at <unknown source file>
:<unknown line>
   6: tokio::runtime::Runtime::block_on::h06d989f050de7999
      at
<unknown source file>:<unknown line>
   7: std::sys_common::backtrace::__rust_begin_short_backtrace::h982544f7fdb35082
      at <unknown source file>:<unknown line>
   8: core::ops::function::FnOnce::call_once{{vtable.shim}}
::h7816247341932812
      at <unknown source file>:<unknown line>
   9: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9c8e6a5588015fe3
      at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/alloc/src/boxed.rs
:1636

  10: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
::h18a9c76a48f9e45c
      at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/alloc/src/boxed.rs:1636

  11: std::sys::unix::thread::Thread::new::thread_start::hc25deba60b0e3cb9
      at
/rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys/unix/thread.rs:106

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.