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

ROS2 through docker: failed to configure logging: Failed to create log directory

asked 2022-04-20 05:16:58 -0600

AlexandrosNic gravatar image

updated 2022-04-22 03:47:11 -0600

I am trying to run ROS2 with x11 support through docker, but I receive this error when I try to open rviz2:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-cocobots'
[ERROR] [1650449124.107459824] [rclcpp]: rcl context unexpectedly not shutdown during cleanup
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
  what():  failed to configure logging: Failed to create log directory: /home/cocobots/.ros/log, at /tmp/binarydeb/ros-foxy-rcl-logging-spdlog-1.1.0/src/rcl_logging_spdlog.cpp:100
Aborted (core dumped)

Indeed there is no log directory in /home/cocobots/.ros/log Anyone knows what may causes the error?

edit retag flag offensive close merge delete

Comments

It was probably an ownership problem. I had the same error, it was fixed after giving my user the ownership of his home directory. chown -R user /home/user

Jasmin gravatar image Jasmin  ( 2022-06-15 23:19:57 -0600 )edit

Have there been any updates on this? I gave the user ownership of their home directory but that hasn't fixed it. The issue is also infrequent. I cannot get it to show up every time I run my ROS2 packages but it is still present about 20% of the time.

Zach gravatar image Zach  ( 2022-06-21 17:39:28 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-22 03:40:31 -0600

AlexandrosNic gravatar image

updated 2022-06-30 09:42:36 -0600

I had to change to the root user in order for ROS to work ( docker run ... --user=root ...). Also, rocker by tfoote is another handy tool to tackle this

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-04-20 05:16:58 -0600

Seen: 1,448 times

Last updated: Jun 30 '22