ros2 / ros2/ros2cli

Discovery fails if daemon is started as root

Open
#598 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
262
Forks
228
Avg merge
23h 15m
Merged PRs (30d)
12

Description

Bug report

Required Info:

  • Operating System: Ubuntu 20.04
  • Installation type: official foxy docker image
  • Version or commit hash:
  • DDS implementation: rmw_fastrtps_cpp
  • Client library (if applicable):
Steps to reproduce issue
Open two terminal sessions. In the first terminal run:
$ docker run -it --rm --name test ros:foxy
root@f536811845fe:/# apt update -y && apt upgrade -y
...
root@f536811845fe:/# useradd test -m
root@f536811845fe:/# sudo -u test bash
test@f536811845fe:/$  . /opt/ros/foxy/setup.bash
test@f536811845fe:/$ ros2 topic pub /test std_msgs/String "data: Hello"
publisher: beginning loop
publishing #1: std_msgs.msg.String(data='Hello')
...

In second terminal run:
$ docker exec -it test bash
root@f536811845fe:/# . /opt/ros/foxy/setup.bash
root@f536811845fe:/# ros2 topic list
/parameter_events
/rosout

Expected behavior

Topic /test should be visible on topic list

Actual behavior

Topic /test is not present.

Additional information

Even after stopping root-owned _ros2_daemon and starting a new one as "test" user, topics in existing nodes are not discovered.

This issue only appears when ros packages are upgraded to the latest version from apt repository.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the Docker and ros2 topic commands in the issue, comparing discovery when the daemon runs as root and as test. Start by tracing the ros2 daemon and topic list entry points involved in discovery; done means /test appears reliably after the daemon is started under either user following an apt upgrade.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.