Rosanswers logo

Hi, I have ROS indigo installed on Ubuntu 14.04 on Beaglebone Black. Everything was working ok, but I made some file permission changes (I know, or actually I don't know, but that's another question). Now I get an error when I run catkin_make. It is some kind of permission error, but it doesn't say what the object is or what permission is required. The output is below. I checked the build log and error log, but there was nothing useful that I could see. I can upload them if needed. Thanks for any possible solution.


ubuntu@arm:~/catkin_ws$ catkin_make

Base path: /home/ubuntu/catkin_ws
Source space: /home/ubuntu/catkin_ws/src
Build space: /home/ubuntu/catkin_ws/build
Devel space: /home/ubuntu/catkin_ws/devel
Install space: /home/ubuntu/catkin_ws/install
#### Running command: "make cmake_check_build_system" in "/home/ubuntu/catkin_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.14
Traceback (most recent call last):
  File "/home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py", line 22, in <module>
    code = generate_environment_script('/home/ubuntu/catkin_ws/devel/env.sh')
  File "/opt/ros/indigo/lib/python2.7/dist-packages/catkin/environment_cache.py", line 61, in generate_environment_script
    output = subprocess.check_output([env_script, sys.executable, '-c', python_code])
  File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
***OSError: [Errno 13] Permission denied***
CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/all.cmake:186 (safe_execute_process)
  /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:52 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
ubuntu@arm:~/catkin_ws$ cat /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake
macro(safe_execute_process cmd_keyword arg1)
  set(_cmd ${arg1})
  foreach(_arg ${ARGN})
    set(_cmd "${_cmd} \"${_arg}\"")

  debug_message(2 "execute_process(${_cmd})")
  execute_process(${ARGV} RESULT_VARIABLE _res)

  if(NOT _res EQUAL 0)
    message(FATAL_ERROR "execute_process(${_cmd}) returned error code ${_res}")



Thanks for the reply.

I ran the following 3 commands to try to sort things out, but it didn't help:

sudo find /usr/lib/python2.7 -exec chmod 777 {} ;

sudo find /home/ubuntu -exec chmod go+rw {} ;

sudo find /opt/ros/indigo/lib -exec chmod 777 {} ;

It looks like the error is happening in subprocess.py:

File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 13] Permission denied

I tried looking at the code, but it wasn't helpful.

Below is the output from the two ls commands you requested. Thanks again.

ubuntu@arm:~/catkin_ws$ ls -al /home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py

-rw-rw-rw- 1 ubuntu ubuntu 1271 Jun 7 22:01 /home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py


ubuntu@arm:~/catkin_ws$ ls -al /home/ubuntu/catkin_ws/build

total 96

drwxrwxrwx 9 ubuntu ubuntu 4096 Sep 18 20:11 .

drwxrwxrwx 5 ubuntu ubuntu 4096 Sep 17 01:04 ..

-rw-rw-rw- 1 ubuntu ubuntu 0 Sep 18 20:11 CATKIN_IGNORE

-rw-rw-rw- 1 ubuntu ubuntu 18782 Sep 17 01:57 CMakeCache.txt

drwxrwxrwx 9 ubuntu ubuntu 4096 Sep 16 22:47 CMakeFiles

-rwxrwxrwx 1 ubuntu ubuntu 310 Jun 5 20:33 CTestTestfile.cmake

-rw-rw-rw- 1 ubuntu ubuntu 22924 Sep 15 23:14 Makefile

drwxrwxrwx 5 ubuntu ubuntu 4096 Sep 15 23:14 beginner_tutorials

drwxrwxrwx 3 ubuntu ubuntu 4096 Jun 5 01:28 catkin

drwxrwxrwx 4 ubuntu ubuntu 4096 Sep 18 20:11 catkin_generated

-rwxrwxrwx 1 ubuntu ubuntu 141 Sep 18 20:11 catkin_make.cache

-rwxrwxrwx 1 ubuntu ubuntu 7423 Jun 5 20:33 cmake_install.cmake

drwxrwxrwx 3 ubuntu ubuntu 4096 Sep 15 23:14 gtest

drwxrwxrwx 4 ubuntu ubuntu 4096 Jun 7 22:38 ros-keyboard-master

drwxrwxrwx 2 ubuntu ubuntu 4096 Jun 5 01:28 test_results


The following item in the Traceback:

File "/home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py", line 22, in <module>
     code = generate_environment_script('/home/ubuntu/catkin_ws/devel/env.sh')

points to this line of code:

22 code = generate_environment_script('/home/ubuntu/catkin_ws/devel/env.sh')

I checked env.sh and it was not executable, so I set it to be executable, but catkin_make failed in exactly the same way afterward. When I looked at env.sh the executable flag was off again. It appears that this file is being (re)created during the build, but without being marked executable, which crashes the process later on.

================================================================================================ Ok, I removed everything and reinitialized the catkin workspace, then ran catkin_make on the empty workspace. It still failed exactly as before. Any more ideas?

Originally posted by bsculley on ROS Answers with karma: 17 on 2015-09-17

Post score: 0


1 Answer 1


Rosanswers logo

The env.sh file is generated from the following template: /opt/ros/indigo/share/catkin/cmake/templates/env.sh.in The template itself should be executable - the permissions are simply transferred.

If that is not the case (since you have already fiddled with the system files) I would recommend to reinstall all ros-indigo-* packages as well as the python packages like python-catkin-pkg.

Originally posted by Dirk Thomas with karma: 16276 on 2015-09-19

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by bsculley on 2015-09-19:
I agree with DIrk, that the template permissions were probably bad. Had I gotten the hint an hour earlier I would have tried it.

As it is, I ended up purging ROS and starting over. That worked.

Thanks to everyone for your efforts.


Comment by gvdhoorn on 2015-09-19:
@bsculley: that is exactly what @Dirk Thomas suggested, so I guess you mark his answer as the answer.

Comment by Windel on 2021-05-10:
Interesting, thanks for the hints here! I ran into this issue as well. For some reason the template was not executable. It probably should not be executable, since executing the template does not make sense. What should probably happen, is dat the template should be used, and the generated file should explicitly be marked executable.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.