Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to open listener tcp/[::]:0, even when specifying an IPv4 address #84

Closed
gravemalte opened this issue Feb 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@gravemalte
Copy link

gravemalte commented Feb 26, 2024

Describe the bug

Hey!

I'm trying to run zenoh-bidge-ros2dds binary, but the binary won't start because the TCP listener can't be bound. The strange thing is, that the listener is trying to bind it to the auto interface [::]:0 local address, even when specifying an IPv4 address.
I'm running an unmodified Ubuntu 23.10, but now the strange thing. When using Ubuntu 22.04 or EndeavourOS, Zenoh is starting successfully. So I suspect a network interface misbehaviour (maybe due to misconfiguration or an Ubuntu specific issue with resolving the network interface).

Nevertheless, maybe someone is able to reproduce this issue.

To reproduce

  1. Get Ubuntu 23.10
  2. Get zenoh-bridge-ros2dds
  3. Start the zenoh-bridge-ros2dds bridge with or without parameters
  4. Crash with the following error message:
INFO  zenoh_bridge_ros2dds] zenoh-bridge-ros2dds v0.11.0-dev-39-g9547868
INFO  zenoh::net::runtime] Using PID: 81592944a3adf6c4bcbc2efa2d045072
ERROR zenoh::net::runtime::orchestrator] Unable to open listener tcp/[::]:0: 
Can not create a new TCP listener bound to tcp/[::]:0: [[::]:0: Address family not supported by protocol (os error 97) 
at /home/user/.cargo/git/checkouts/zenoh-cc237f2570fab813/42f9384/io/zenoh-links/zenoh-link-tcp/src/unicast.rs:222.] 
at /home/user/.cargo/git/checkouts/zenoh-cc237f2570fab813/42f9384/io/zenoh-links/zenoh-link-tcp/src/unicast.rs:305.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: 
Can not create a new TCP listener bound to tcp/[::]:0: [[::]:0: Address family not supported by protocol (os error 97) 
at /home/user/.cargo/git/checkouts/zenoh-cc237f2570fab813/42f9384/io/zenoh-links/zenoh-link-tcp/src/unicast.rs:222.]
at /home/user/.cargo/git/checkouts/zenoh-cc237f2570fab813/42f9384/io/zenoh-links/zenoh-link-tcp/src/unicast.rs:305.', zenoh-bridge-ros2dds/src/main.rs:77:62

System info

  • Platform: Ubuntu 23.10
  • CPU: Intel i7-1255U (x86_64)
  • Zenoh version: main source build and CI binary
@gravemalte gravemalte added the bug Something isn't working label Feb 26, 2024
@gravemalte gravemalte changed the title [Bug] Unable to open listener tcp/[::]:0 [Bug] Unable to open listener tcp/[::]:0, even when specifying an IPv4 address Feb 26, 2024
@JEnoch
Copy link
Member

JEnoch commented Feb 27, 2024

It was a deliberate choice in Zenoh to bind by default on TCP/IPv6 ANY address with a port chosen by the OS, i.e. [::]:0 (see eclipse-zenoh/zenoh#366).
It looks like your Ubuntu 23.10 is configured without the support of IPv6.

Still, you should be able to force the binding to TCP/IPv4 ANY address as such:
zenoh-bidge-ros2dds -l tcp/0.0.0.0:0

@gravemalte
Copy link
Author

gravemalte commented Feb 27, 2024

Hi, thanks for your answer!

Yeah, the zenoh-bridge-ros2dds -l tcp/127.0.0.1:7447 is working fine, but connecting to a binded port using the following:
zenoh-bridge-ros2dds -e tcp/127.0.0.1:7447 crashes the zenoh bridge. Or am I missing something for the connection part?

@JEnoch
Copy link
Member

JEnoch commented Mar 1, 2024

-e tcp/127.0.0.1:7447 specifies the bridge it should try to connect to 127.0.0.1 (localhost IP) on port 7447.
If you don't have another Zenoh router or peer running on the same host and which is listening on this port (via -l 127.0.0.1:7447 or -l tcp/0.0.0.0:7447) then the bridge can't establish the connection.
If the bridge is in peer mode (by default), it doesn't harm - the bridge keeps periodically trying and failing silently.
If the bridge is in client mode, it exits with an error after a timeout. This is because a Zenoh client must have 1 (and only 1) connection established to a router or a peer.

@gravemalte
Copy link
Author

Thank you, I have solved the problem. The reference to client mode makes sense. Sorry for the inconvenience. I am closing the issue.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants