1
$\begingroup$

I am experiencing problems with colcon build. I am running it in x64 Native Tools Command Prompt for VS 2019 as admin. I get this error for every colcon build i was trying to create.

I am using ROS2 foxy for Windows. View the full Error Message below:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>c:\opt\ros\foxy\x64\setup.bat

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>cd \dev\ros2_ws

C:\dev\ros2_ws>colcon build --symlink-install --merge-install

[0.790s] root DEBUG Using proactor: IocpProactor
Starting >>> examples_rclcpp_minimal_action_client
[0.804s] colcon.colcon_ros.prefix_path.catkin WARNING The path 'C:\opt\ros\foxy\x64\tools\vcpkg\installed\x64-windows' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Starting >>> examples_rclcpp_minimal_action_server
Starting >>> examples_rclcpp_minimal_client
Starting >>> examples_rclcpp_minimal_composition
Starting >>> examples_rclcpp_minimal_publisher
Starting >>> examples_rclcpp_minimal_service
Starting >>> examples_rclcpp_minimal_subscriber
Starting >>> examples_rclcpp_minimal_timer
Starting >>> examples_rclcpp_multithreaded_executor
Starting >>> examples_rclpy_executors
Starting >>> examples_rclpy_minimal_action_client
Starting >>> examples_rclpy_minimal_action_server
--- stderr: examples_rclcpp_minimal_action_client
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_action_client [0.80s, exited with code 1]
--- stderr: examples_rclcpp_minimal_action_server
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_action_server [0.73s, exited with code 1]
--- stderr: examples_rclcpp_minimal_client
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_client [0.67s, exited with code 1]
--- stderr: examples_rclcpp_minimal_composition
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_composition [0.61s, exited with code 1]
--- stderr: examples_rclcpp_minimal_publisher
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_publisher [0.58s, exited with code 1]
--- stderr: examples_rclcpp_minimal_service
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_service [0.51s, exited with code 1]
--- stderr: examples_rclcpp_minimal_subscriber
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_subscriber [0.47s, exited with code 1]
--- stderr: examples_rclcpp_minimal_timer
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_minimal_timer [0.39s, exited with code 1]
--- stderr: examples_rclcpp_multithreaded_executor
Traceback (most recent call last):
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 59, in build
    rc = await extension.build(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 87, in build
    rc = await self._reconfigure(args, env)
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py", line 174, in _reconfigure
    completed = await run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py", line 177, in run
    completed = await colcon_core_subprocess_run(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 81, in run
    rc, _, _ = await _async_check_call(
  File "c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py", line 139, in _async_check_call
    process = await create_subprocess(
  File "asyncio\subprocess.py", line 236, in create_subprocess_exec
  File "asyncio\base_events.py", line 1630, in subprocess_exec
  File "asyncio\windows_events.py", line 385, in _make_subprocess_transport
  File "asyncio\base_subprocess.py", line 36, in __init__
  File "asyncio\windows_events.py", line 881, in _start
  File "asyncio\windows_utils.py", line 153, in __init__
  File "subprocess.py", line 854, in __init__
  File "subprocess.py", line 1307, in _execute_child
PermissionError: [WinError 5] Zugriff verweigert
---
Failed   <<< examples_rclcpp_multithreaded_executor [0.33s, exited with code 1]
Aborted  <<< examples_rclpy_executors [1.16s]
Aborted  <<< examples_rclpy_minimal_action_server [1.00s]
Aborted  <<< examples_rclpy_minimal_action_client [1.08s]

 

Summary: 0 packages finished [2.03s]
  9 packages failed: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer examples_rclcpp_multithreaded_executor
  3 packages aborted: examples_rclpy_executors examples_rclpy_minimal_action_client examples_rclpy_minimal_action_server
  9 packages had stderr output: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer examples_rclcpp_multithreaded_executor
  4 packages not processed
[WinError 5] Zugriff verweigert

Does someone has any ideas on how to resolve this?

$\endgroup$

2 Answers 2

1
$\begingroup$

The issue is with --symlink_install

Symbolic links are supported in a limited way on Windows but as far as I know you have to enable developer mode to use it without administrative privilege escalation:

https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/

https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development

More here:

https://github.com/ros2/ros2/issues/356#issuecomment-306889961

$\endgroup$
4
  • 1
    $\begingroup$ Unfortunately the issue is not connected to --symlink_install. I have the same issue running any colcon command even without --symlink_install. I still tried to enable the "for developer" features, but this did not change or fix anythink. Thank you for your idea though :) $\endgroup$
    – Vincent
    Commented Oct 4, 2023 at 9:33
  • $\begingroup$ I wonder if you actually have a directory permissions error, I would double-check for read-only folders and similar issues. I don't see why your workspace would have this issue, though. My next step here would probably be to add some temporary debug printing in colcon_core\subprocess.py to see what it's trying to do that is getting denied. You may also get some more info from colcon with --event-handlers console_direct+ or --event-handlers console_cohesion+ $\endgroup$ Commented Oct 4, 2023 at 12:42
  • $\begingroup$ I think the subprocess tries to call a command with the following args: ['"C:\\dev\\ros2_ws\\build\\turtlesim\\colcon_command_prefix_build.bat" && set'] I don't see a problem with that, but maybe you do. I thought of maybe trying to start some different subprocesses using python to narrow down the cause. $\endgroup$
    – Vincent
    Commented Oct 5, 2023 at 10:48
  • $\begingroup$ This was somehow fixed here: github.com/ms-iot/ROSOnWindows/issues/… $\endgroup$
    – Vincent
    Commented Nov 6, 2023 at 16:24
1
$\begingroup$

This was somehow fixed and was related to Cmake: https://github.com/ms-iot/ROSOnWindows/issues/448#issuecomment-1766756522

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.