ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

SROS Docker and Ubuntu install fails due to missing dependencies etc.

asked 2018-07-24 05:59:57 -0600

Nitro24 gravatar image

Hello, i already stated this as a github issue Link, but got kindly redirected to ROS Answers with my issues.


While trying to follow the official SROS Tutorials (, I had some issues when trying to start the sroskeyserver. The same errors also occur when running the prebuilt Docker container, so i suppose, that the problem is due to some inconsistencies in the SROS repository or its dependencies.

At first i've pulled the docker and tried to run the command from the install page:

docker run --rm -it \
osrf/sros \
bash -c "source / && \
    sroskeyserver & \
    sleep 3 && \
    sroslaunch rospy_tutorials talker_listener.launch"

Somehow this runs into the following problem:

Traceback (most recent call last):
  File "/root/sros_catkin_ws/install/bin/sroskeyserver", line 2, in <module>
    import sros
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/sros/", line 7, in <module>
    import rosgraph.sros_consts as sros_consts
  ImportError: No module named rosgraph.sros_consts
  Traceback (most recent call last):
  File "/root/sros_catkin_ws/install/bin/sroslaunch", line 2, in <module>
    import sros
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/sros/", line 7, in <module>
    import rosgraph.sros_consts as sros_consts
  ImportError: No module named rosgraph.sros_consts

Therefore I checked the ros_comm package, which is not available in the Docker container as it is ignored by using an AMENT_IGNORE file.


So I tried to remove the AMENT_IGNORE files, which (after building again) resulted at least in a usable ros_comm installation (i.e. import in python was working), however also resulted in "abandoned packages".

Furthermore i tried again to start the sroskeyserver, but there were some packages missing (cryptography, pyopenssl, apparmor).

After finally installing all of the missing dependencies, i ran into the following error trying to start the keyserver again:

root@5c14d417a2ec:~/sros_catkin_ws# sroskeyserver 
Starting an XML-RPC server to bootstrap SSL key distribution...
Traceback (most recent call last):
  File "/root/sros_catkin_ws/install/bin/sroskeyserver", line 3, in <module>
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/sros/", line 179, in sroskeyserver_main
    keyserver.start_keyserver(keyserver_config, keystore_path, keyserver_mode, port)
  File "/root/sros_catkin_ws/install/lib/python2.7/dist-packages/rosgraph/", line 143, in start_keyserver
UnboundLocalError: local variable 'keyserver' referenced before assignment

So this looks like an more in-depth error for me and since i used the official Docker image, I was wondering if there is already a known solution for this. Is SROS still maintained or should I check out SROS2? Even if SROS is not maintained anymore, I am ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-24 16:14:01 -0600

ruffsl gravatar image

Looks like catkin now ignores AMENT_IGNORE, and the holdover AMENT_IGNORE s from codebot are now effecting the build. This PR fixes the issue, as when I run the command from the install page using the new branch when rebuilding the dockerfile, the sample command from the readme continues to works:

Alternately, you could remove them while building the dockerfile like so, by adding the last line.

# download sourcecode for sros
RUN rosinstall_generator \
      ros_comm \
      rospy_tutorials \
      --rosdistro ${ROS_DISTRO} \
      --deps \
      --tar > ${ROS_DISTRO}-ros_comm-wet.rosinstall && \
    wstool init -j8 . ${ROS_DISTRO}-ros_comm-wet.rosinstall && \
    rm -rf ros_comm && \
    git clone -b sros && \
    git clone -b sros ../rospkg && \
    find ./ros_comm -name "AMENT_IGNORE" -print0 | xargs -0 rm -rf

As the original dev for SROS1, I haven't worked on this for some time. No surprise evolving dependencies and time would have broken things. Perhaps when I get some more time I'll refactor my original changes to ROS1 Melodic, and try and take a more modular approach to plugins using entry points. There has been some work from Bernhard Dieber et. al. in porting TLS support for roscpp that would be nice to incorporate as well to gain both rospy and roscpp support.

If your still currently evaluating different security concepts for ROS1, I might suggest looking through the book chapter SROS1: Using and Developing Secure ROS1 Systems from Robot Operating System (ROS) The Complete Reference (Volume 3), including the other cited works therein.

SROS2 however is the future, and thus receiving a lot more current development. There will be a SROS2 tutorial at IROS 2018 that I might also suggest for those interested. Complete tutorial materials should be posted on the events web site soon:

edit flag offensive delete link more


Thank you for your kind and fast answer. I was able to build a working image with your changes integrated into the dockerfile.

I've also taken a look into the Chapter and will check out SROS 2 soon, so thank you as well for these suggestions and information about the futurre of SROS(2).

Nitro24 gravatar image Nitro24  ( 2018-08-02 06:25:03 -0600 )edit

Question Tools

1 follower


Asked: 2018-07-24 05:53:14 -0600

Seen: 323 times

Last updated: Jul 24 '18