# Failed to create symbolic link - Services Quiz

**URL:** <https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471>\
**Category:** ROS2 in 5 Days C++\
**Tags:** error\
**Created:** [January 7, 2023, 6:31pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471 "2023-01-07T18:31:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voltedge](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/voltedge/32/7586_2.png) [@Voltedge](https://get-help.theconstruct.ai/u/Voltedge)\
**Post date:** [January 7, 2023, 6:31pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/1 "2023-01-07T18:31:23Z")

</div>

Hi

I was done with the services\_quiz and when I send my solution there’s and error to building

```
   colcon build --packages-select services_quiz_srv services_quiz

```

shell response:

```
user:~/ros2_ws$ colcon build --packages-select services_quiz_srv services_quiz
Starting >>> services_quiz_srv
--- stderr: services_quiz_srv
failed to create symbolic link '/home/user/ros2_ws/build/services_quiz_srv/ament_cmake_python/services_quiz_srv/services_quiz_srv' because existing path cannot be removed: Is a directory
gmake[2]: *** [CMakeFiles/ament_cmake_python_symlink_services_quiz_srv.dir/build.make:70: CMakeFiles/ament_cmake_python_symlink_services_quiz_srv] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:421: CMakeFiles/ament_cmake_python_symlink_services_quiz_srv.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< services_quiz_srv [2.39s, exited with code 2]

Summary: 0 packages finished [2.61s]
  1 package failed: services_quiz_srv
  1 package had stderr output: services_quiz_srv
  1 package not processed

```

Then the process automatic qualify stops and no check the other things.

But, when I trying to launch my server and client by myself, both of them work and do the task.  
I don’t understand the error.

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [January 8, 2023, 7:03am UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/2 "2023-01-08T07:03:59Z")

</div>

Hi @Voltedge ,

> [@Voltedge](#):
>
> `failed to create symbolic link '/home/user/ros2_ws/build/services_quiz_srv/ament_cmake_python/services_quiz_srv/services_quiz_srv' because existing path cannot be removed: Is a directory`

Did you create `services_quiz_srv` package with build-type as `ament_cmake` or `ament_cmake_python`?  
Because from the error code above, I infer that you have used the wrong build type.

You must build `services_quiz_srv` with build-type `ament_cmake`.

To see which build-type your package uses, check your `<build_type>` tag in your `package.xml`.

If you have used `ament_cmake_python` then re-create the package from scratch using `ament_cmake`.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![Voltedge](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/voltedge/32/7586_2.png) [@Voltedge](https://get-help.theconstruct.ai/u/Voltedge)\
**Post date:** [January 8, 2023, 2:40pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/3 "2023-01-08T14:40:10Z")

</div>

Hi @girishkumar.kannan

both of them are ament\_cmake

```
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>services_quiz_srv</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="user@todo.todo">user</maintainer>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <depend>rclcpp</depend>
  <depend>std_msgs</depend>

  
  <build_depend>rosidl_default_generators</build_depend>
  <exec_depend>rosidl_default_runtime</exec_depend>
  <member_of_group>rosidl_interface_packages</member_of_group>

  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>

```

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [January 8, 2023, 3:17pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/4 "2023-01-08T15:17:27Z")

</div>

Hi @Voltedge ,

Delete `build`, `install` and `log` folders from `ros2_ws` and try to build all the packages again.  
Simply do `colcon build` after deleting the above 3 folders.

That should most likely fix your problem. Let me know if that does not fix!

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![Voltedge](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/voltedge/32/7586_2.png) [@Voltedge](https://get-help.theconstruct.ai/u/Voltedge)\
**Post date:** [January 8, 2023, 3:46pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/5 "2023-01-08T15:46:08Z")

</div>

Hi @girishkumar.kannan

I delete those files and then compile with: colcon build

```
user:~/ros2_ws$ colcon build
Starting >>> services_quiz_srv
[0.731s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/topics_quiz' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.731s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/services_quiz' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.731s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/services_quiz_srv' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.731s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/server_pkg' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/my_package' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/exercise42_pkg' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/custom_interfaces' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/client_pkg' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topics_quiz' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topic_subscriber_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topic_publisher_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/services_quiz' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/services_quiz_srv' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/server_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/my_package' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/exercise42_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/custom_interfaces' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.732s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/client_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Starting >>> client_pkg
Starting >>> exercise42_pkg
Starting >>> server_pkg
Starting >>> topics_quiz
[Processing: client_pkg, exercise42_pkg, server_pkg, services_quiz_srv, topics_quiz]
Finished <<< exercise42_pkg [32.5s]
Finished <<< services_quiz_srv [39.6s]
Starting >>> services_quiz
Finished <<< server_pkg [39.6s]
Finished <<< client_pkg [40.2s]
Finished <<< topics_quiz [42.7s]
Finished <<< services_quiz [15.9s]

Summary: 6 packages finished [55.7s]

```

Second compile with :

```
       colcon build --packages-select services_quiz_srv services_quiz

  user:~/ros2_ws$ colcon build --packages-select services_quiz_srv services_quiz
  Starting >>> services_quiz_srv
  [0.659s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/my_package' in the environment variable AMENT_PREFIX_PATH doesn't exist
  [0.659s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/custom_interfaces' in the environment variable AMENT_PREFIX_PATH doesn't exist
  [0.659s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topic_subscriber_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
  [0.660s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topic_publisher_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
  [0.660s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/my_package' in the environment variable CMAKE_PREFIX_PATH doesn't exist
  [0.660s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/custom_interfaces' in the environment variable CMAKE_PREFIX_PATH doesn't exist
  Finished <<< services_quiz_srv [1.07s]
  Starting >>> services_quiz
  Finished <<< services_quiz [0.30s]
  
  Summary: 2 packages finished [1.56s]

```

I guess that this errors will make me fail the services\_quiz again ?

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [January 8, 2023, 4:06pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/6 "2023-01-08T16:06:28Z")

</div>

Hi @Voltedge ,

Please just take a moment to read the output. Those are not errors. Just warnings.  
All your packages are successfully compiled.

Just execute your package. They should run fine!

Execute them manually (on the terminal by yourself) first. Then use the gradebot.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![Voltedge](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/voltedge/32/7586_2.png) [@Voltedge](https://get-help.theconstruct.ai/u/Voltedge)\
**Post date:** [January 8, 2023, 10:36pm UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/7 "2023-01-08T22:36:56Z")

</div>

Hi @girishkumar.kannan

I did a full build, then one on the 2 packages (services\_quiz, services\_quiz\_srv) and everything works. But then I use Gradebot and I get the same error again.

I compile again and now I get the same error from the beginning…

```
    user:~/ros2_ws$ colcon build
    Starting >>> services_quiz_srv
    Starting >>> client_pkg
    Starting >>> exercise42_pkg
    Starting >>> server_pkg
    Starting >>> topics_quiz
    Finished <<< exercise42_pkg [3.68s]
    Finished <<< client_pkg [3.71s]
    Finished <<< topics_quiz [3.72s]
    Finished <<< services_quiz_srv [4.32s]
    Starting >>> services_quiz
    Finished <<< server_pkg [4.30s]
    Finished <<< services_quiz [0.30s]
    
    Summary: 6 packages finished [5.80s]
    user:~/ros2_ws$ ros2 launch services_quiz services_quiz_server.launch.py
    [INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-01-08-22-29-24-569262-4_xterm-2048
    [INFO] [launch]: Default logging verbosity is set to INFO
    [INFO] [srv_cpp-1]: process started with pid [2049]
    ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
    [srv_cpp-1] [INFO] [1673216992.292107343] [rclcpp]: signal_handler(signum=2)
    [INFO] [srv_cpp-1]: process has finished cleanly [pid 2049]
    user:~/ros2_ws$ colcon build --packages-select services_quiz services_quiz_srv
    Starting >>> services_quiz_srv
    Finished <<< services_quiz_srv [0.99s]
    Starting >>> services_quiz
    Finished <<< services_quiz [0.25s]
    
    Summary: 2 packages finished [1.41s]

```

Here I send to the Gradebot and I fail again. So, when I compile again…

```
    user:~/ros2_ws$ colcon build --packages-select services_quiz services_quiz_srv
    Starting >>> services_quiz_srv
    --- stderr: services_quiz_srv
    failed to create symbolic link '/home/user/ros2_ws/build/services_quiz_srv/ament_cmake_python/services_quiz_srv/services_quiz_srv' because existing path cannot be removed: Is a directory
    gmake[2]: *** [CMakeFiles/ament_cmake_python_symlink_services_quiz_srv.dir/build.make:70: CMakeFiles/ament_cmake_python_symlink_services_quiz_srv] Error 1
    gmake[1]: *** [CMakeFiles/Makefile2:421: CMakeFiles/ament_cmake_python_symlink_services_quiz_srv.dir/all] Error 2
    gmake[1]: *** Waiting for unfinished jobs....
    gmake: *** [Makefile:146: all] Error 2
    ---
    Failed <<< services_quiz_srv [0.31s, exited with code 2]
    
    Summary: 0 packages finished [0.52s]
      1 package failed: services_quiz_srv
      1 package had stderr output: services_quiz_srv
      1 package not processed
    user:~/ros2_ws$

```

What I am wrong?

---

<div class="post-metadata">

**Author:** ![Zlatan](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/z/a183cd/32.png) [@Zlatan](https://get-help.theconstruct.ai/u/Zlatan)\
**Post date:** [February 4, 2023, 7:53am UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/8 "2023-02-04T07:53:13Z")

</div>

Good evening,  
To solve the issue, delete manually the folder ros2\_ws/build/services\_quiz\_srv/ament\_cmake\_python;

then, do a bunch of compilation attempts on your own before you try to resubmit;

I have no clue what’s happening, but I suspect that when we compile an interface package for the first time, that directory gets odd permissions and the compiler can’t mess with it anymore;

Hope this helps

Kind regards

Francesco

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [February 16, 2023, 8:31am UTC](https://get-help.theconstruct.ai/t/failed-to-create-symbolic-link-services-quiz/21471/9 "2023-02-16T08:31:38Z")

</div>


