OSError: [Errno 13] Permission denied: '/catkin_generated'

asked 2020-01-31 10:45:06 -0600

VivosLespagnos gravatar image

updated 2020-02-02 11:28:36 -0600

gvdhoorn gravatar image

Hi everybody,

I trying to compil my package but something doesn't work, I don't find on Internet any answer ! Someone have already had this error ??

Invoking "cmake" failed

crabe@PRJ11:~/catkin_ws$ catkin_make --only-pkg-with-deps versec
Base path: /home/crabe/catkin_ws
Source space: /home/crabe/catkin_ws/src
Build space: /home/crabe/catkin_ws/build
Devel space: /home/crabe/catkin_ws/devel
Install space: /home/crabe/catkin_ws/install
Creating symlink "/home/crabe/catkin_ws/src/CMakeLists.txt" pointing to "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake"
Whitelisted packages: versec
#### Running command: "make cmake_check_build_system" in "/home/crabe/catkin_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/crabe/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/crabe/catkin_ws/devel;/opt/ros/melodic
-- This workspace overlays: /home/crabe/catkin_ws/devel;/opt/ros/melodic
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- catkin 0.7.20
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - versec
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'versec'
-- ==> add_subdirectory(versec)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
Traceback (most recent call last):
  File "/opt/ros/melodic/share/catkin/cmake/order_paths.py", line 35, in <module>
  File "/opt/ros/melodic/share/catkin/cmake/order_paths.py", line 28, in main
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
**OSError: [Errno 13] Permission denied: '/catkin_generated'**
CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  "/usr/bin/python2" "/opt/ros/melodic/share/catkin/cmake/order_paths.py"
  "/catkin_generated/ordered_paths.cmake" "--paths-to-order"
  "/opt/ros/melodic/include" "/usr/include" "/usr/include/opencv"
  "--prefixes" "/home/crabe/catkin_ws/devel" "/home/crabe/catkin_ws/src"
  "/home/crabe/catkin_ws/devel" "/home/crabe/catkin_ws/src"
  "/opt/ros/melodic") returned error code 1
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/list_insert_in_workspace_order.cmake:29 (safe_execute_process)
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:108 (list_insert_in_workspace_order)
  versec/CMakeLists.txt:59 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/crabe/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/crabe/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:588: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
**Invoking "make cmake_check_build_system" failed**

thanks you ;

When I apply "ls -lah", then cd build and "ls -lah" again :

crabe@PRJ11:~$ roscd
crabe@PRJ11:~/catkin_ws$ ls -lah
total 36K
drwxr-xr-x  7 crabe crabe 4,0K janv. 31 12:42 .
drwxr-xr-x 34 crabe crabe 4,0K janv. 31 20:40 ..
drwxr-xr-x 31 crabe crabe 4,0K janv. 31 17:26 build
-rw-r--r--  1 crabe crabe   98 nov.  17 17:26 .catkin_workspace
drwxr-xr-x  5 crabe crabe 4,0K janv. 30 11:14 devel
drwxr-xr-x  4 crabe crabe 4,0K nov.  17 18:58 install
drwxr-xr-x  8 crabe crabe 4,0K nov.  17 18:38 rosdep
-rw-r--r--  1 crabe crabe 2,4K janv. 31 12:42 seub.cpp
drwxr-xr-x 14 crabe crabe 4,0K janv. 31 17:26 src
crabe@PRJ11 ...
edit retag flag offensive close merge delete


It looks like you have permission issues with your folders on catkin_ws. Please run "ls -lah" on your catkin_ws and then run "cd build" and "ls -lah" again, and update your question with the result.

lucascoelho gravatar image lucascoelho  ( 2020-01-31 13:27:38 -0600 )edit

Please note the / in front of catkin_generated. That directory is typically not found in the root of your partition. It's very likely there is no /catkin_generated directory.

It looks like Catkin is instructing cmake to try and create the catkin_generated directory in /, which will fail, as the crabe user doesn't have the access permissions to do so.

I don't know right now what is causing this, but I doubt permissions are a problem here.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-02 11:30:17 -0600 )edit