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

Catkin make error

asked 2015-09-17 17:16:03 -0500

bsculley gravatar image

updated 2015-09-25 00:37:37 -0500

130s gravatar image

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.

Bob

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
-- Using CATKIN_ENABLE_TESTING: ON
-- 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):
  execute_process(/usr/bin/python
  "/home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py")
  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}\"")
  endforeach()

  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}")
  endif()
endmacro()

ubuntu@arm:~/catkin_ws$

=============================================================================

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 ... (more)

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2015-09-19 12:47:34 -0500

Dirk Thomas gravatar image

updated 2015-09-19 15:46:04 -0500

gvdhoorn gravatar image

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.

edit flag offensive delete link more

Comments

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.

Bob

bsculley gravatar image bsculley  ( 2015-09-19 13:17:12 -0500 )edit

@bsculley: that is exactly what @Dirk Thomas suggested, so I guess you mark his answer as the answer.

gvdhoorn gravatar image gvdhoorn  ( 2015-09-19 15:47:09 -0500 )edit

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.

Windel gravatar image Windel  ( 2021-05-10 03:21:46 -0500 )edit
0

answered 2016-02-11 14:03:42 -0500

thomy gravatar image

In my case, it fixed when i

x@x:~$ export ROS_PACKAGE_PATH=/home/<the_path_to_the_working_folder>:${ROS_PACKAGE_PATH}

^moved to home directory for Additional PATH Environment Variables

edit flag offensive delete link more
0

answered 2015-09-18 01:54:52 -0500

gvdhoorn gravatar image

updated 2015-09-19 11:57:22 -0500

It is some kind of permission error, but it doesn't say what the object is or what permission is required.

From:

CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/usr/bin/python
  "/home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py")

I'd guess that either /usr/bin/python is no longer accessible to / executable by the user invoking catkin_make (doubtful), or that /home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py now can't be read.

[..] I made some file permission changes [..]

Can you add the output of ls -al /home/ubuntu/catkin_ws/build/catkin_generated/generate_cached_setup.py and maybe also ls -al /home/ubuntu/catkin_ws/build to your question (use the edit button).

Make sure /home/ubuntu/catkin_ws and it's sub directories are (at least) readable by the ubuntu user. If in doubt (and you can afford the time), just remove the build and devel directories and rebuild everything (seeing as you are on arm that may take a while though / not be what you want).


Edit: devel/env.sh is indeed executable on my system. I don't know why it isn't on yours. It is being regenerated, and apparently its recreated without the executable bit set.

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 {} \;

Even if they did, it would not really have been a solution. Changing permissions on system dirs (or any dirs really) like this is really (really) not recommended.

Looking at your build dir, it would seem you have relatively few pkgs in your catkin_ws. We can try and sort things out (the long way), or you could just rm -rf devel && rm -rf build and see whether running catkin_make now works (the quicker way).

No guarantees though, as your system seems to be in a rather strange state.


Edit2:

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?

I can only assume that if you changed permissions on other parts of your system like you did with /usr/lib/python2.7 and /opt/ros/indigo/lib, that something is really borked.

Perhaps @Dirk Thomas can provide some help with the "env.sh does not receive executable permissions" issue.

edit flag offensive delete link more

Comments

That (template having incorrect permissions) sounds like it could be the root cause here.

gvdhoorn gravatar image gvdhoorn  ( 2015-09-19 12:51:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-09-17 17:16:03 -0500

Seen: 8,276 times

Last updated: Feb 11 '16