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

Permission denied when using basic ROS2 CLI

asked 2022-12-30 04:34:13 -0500

MasHyke gravatar image

Hi guys,

I have just made a fresh installation of ROS2 Galactic following the guide in the documentation. I need to use galactic for the time being because of other dependencies in a project.

If I try to run basic ros2 commands like:

ros2 topic list

or

ros2 node list

I get the following error message:

Failed opening file /home/martin/.ros/log/python3_87631_1672396098403.log for writing: Permission denied

It seems that ros does not have permission to create a new file in the .ros/log/ folder.

Have anyone experienced something similar, or know a fix?

Thanks!

System info

Linux 5.15.0-56-generic

Ubuntu 20.04.5 LTS

gcc 9.4.0

ROS_VERSION=2

ROS_PYTHON_VERSION=3

ROS_LOCALHOST_ONLY=0

ROS_DISTRO=galactic

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-12-30 09:37:11 -0500

ljaniec gravatar image

Did you source the ROS2 in the terminal before these commands? Did you use sudo with some of the ROS commands during the installation or installing dependencies? Perhaps you did this (from rosdep -h):

rosdep fix-permissions Recursively change the permissions of the user's ros home directory. May require sudo. Can be useful to fix permissions after calling rosdep update with sudo accidentally.

Please check it in your workspace (sudo rosdep fix-permissions). Can you check your user groups (groups) and show them?

Some related Q&A to check:

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-12-30 04:34:13 -0500

Seen: 723 times

Last updated: Dec 30 '22