ROS2 through docker: failed to configure logging: Failed to create log directory
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?
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
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.