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

service fails on machine with IPv6 enabled #46

Open
astraw opened this issue Feb 12, 2018 · 4 comments
Open

service fails on machine with IPv6 enabled #46

astraw opened this issue Feb 12, 2018 · 4 comments
Labels

Comments

@astraw
Copy link
Contributor

astraw commented Feb 12, 2018

As explained in #41, which I originally thought was likely from a single bug, the rosrust service demo (started with rosrust/examples/serviceclient$ cargo run --bin service) can fail with standard ROS tools:

Node: /add_two_ints_server
URI: rosrpc://localhost:37153
ERROR: Unable to communicate with service [/add_two_ints], address [rosrpc://localhost:37153]

Or

rosservice call add_two_ints 4 5 
ERROR: Unable to communicate with service [/add_two_ints], address [rosrpc://localhost:37153]

I discovered that this does not happen when IPv6 is disabled on the machine in question. The tests were done with the env var ROS_HOSTNAME=localhost.

@adnanademovic
Copy link
Owner

I'm not sure how to replicate this issue.

@clynamen
Copy link

I think setting the ipv6 loopback address in /etc/hosts is enough to reproduce the problem.

No error messages are shown, and no ros message are published. I am not sure wheter ROS is compatible with ipv6, in this case it is an bug in rosrust.
Otherwise, maybe it would be good to raise an error when the hostname is resolved?

@adnanademovic
Copy link
Owner

adnanademovic commented Nov 25, 2018

I thought I did that. This is the /etc/hosts file I use:

127.0.0.1	localhost
127.0.1.1	<my hostname>

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Should I remove the ip6- prefixes or something?

Edit:
I added this line: ::1 localhost loopback, still everything working.

@lparadasanmartin
Copy link

Hi Adnan, Andrew,
Working on the integration of rosrust on my ROS based robot I faced this very same error.
I don't know if this can help you on finding the root cause of the problem Adnan but when not being able to communicate with the service I noticed that I'm also unable to fetch the service info :
rosservice info /my_node/hello_world Node: /my_node URI: rosrpc://localhost:36081 ERROR: Unable to communicate with service [/my_node/hello_world], address [rosrpc://localhost:36081]

The error indeed disappears as soon as I disable IPV6 following Andrew's recommendation: `echo "1" > /proc/sys/net/ipv6/conf/all/disable_ipv6`

Hope this helps, it would be cool to have this working while IPV6 is enabled too :)

Luis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants