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.
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$
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;