"waiting for service to become available" in ros2 service call, and wait_for_service returning False

"waiting for service to become available" in ros2 service call, and wait_for_service returning False: causes and fixes, measured

$ ros2 service call /trigger std_srvs/srv/Trigger
waiting for service to become available...

In code the same problem shows up as client.wait_for_service(timeout_sec=3.0) returning False in rclpy, or wait_for_service(3s) returning false in rclcpp.

Short answer: the client can't find a server with that exact name and that exact type in its own ROS domain. ros2 service call never gives up on its own. It printed the line once and then waited silently until I killed it. Run ros2 service list -t in the same shell as the client, then copy the name and the type from that output into your call:

ros2 service list -t
# /robot1/trigger [std_srvs/srv/Trigger]
ros2 service call /robot1/trigger std_srvs/srv/Trigger

If the service is in the list with the type you used and the call still hangs, look at the line after "waiting". If requester: making request: ... appears and then nothing happens, the client did find the server. The server isn't answering. In my runs that meant the server never spun, or the server and client used different RMW implementations.

Find your cause — measured results table
At a glance: the main measured table from this article. Full details below.

Find your cause

Each row is one cause, tested alone. The four commands on the right ran in the client's shell, with the client's ROS_DOMAIN_ID and RMW. Every row behaved the same on Humble, Jazzy and Lyrical unless noted.

Cause ros2 service call ros2 service list -t ros2 service type /trigger ros2 node info (Service Servers)
No server running waits at "waiting for service..." no /trigger prints nothing, exit 1 no node
Wrong name (server is /add_trigger) waits /add_trigger [std_srvs/srv/Trigger] nothing, exit 1 /add_trigger: std_srvs/srv/Trigger
Server in namespace /robot1, relative name trigger waits /robot1/trigger [std_srvs/srv/Trigger] nothing, exit 1 node is /robot1/wsvc_server, server /robot1/trigger
Server remapped with -r trigger:=trigger_v2 waits /trigger_v2 [std_srvs/srv/Trigger] nothing, exit 1 /trigger_v2: std_srvs/srv/Trigger
Server type is SetBool, CLI says Trigger waits, no error /trigger [std_srvs/srv/SetBool] std_srvs/srv/SetBool /trigger: std_srvs/srv/SetBool
Server in ROS_DOMAIN_ID=7, client in 0 waits empty nothing, exit 1 node not found
Server exited cleanly (SIGTERM) waits empty after 2 s nothing, exit 1 node not found
Server killed with SIGKILL waits /trigger still listed for at least 15 s via the daemon, gone by 30 s; empty with --no-daemon Not tested separately
Server created but never spins prints requester: making request, then hangs /trigger [std_srvs/srv/Trigger] std_srvs/srv/Trigger /trigger: std_srvs/srv/Trigger
Server on rmw_cyclonedds_cpp, client on the default rmw_fastrtps_cpp (and the reverse) prints requester: making request, then hangs sometimes listed, sometimes empty sometimes the type, sometimes exit 1 listed in some runs; in the reversed case ros2 node list was empty

Two groups fall out of this. In the first eight rows the client never finds a matching server, and wait_for_service returns False. In the last two rows the client finds one, wait_for_service returns True after 0.00 to 2.42 s, and the request never gets a reply.

What I ran

On 2026-10-31 I used the official ros:humble-ros-base, ros:jazzy-ros-base and ros:lyrical-ros-base images, one after another, with every process in one container. One package held four programs. py_server.py and cpp_server create a std_srvs/srv/Trigger service (the Python one can also use SetBool) and either spin or just sleep. py_client.py and cpp_client call wait_for_service with a timeout and print what it returned and how long it took. All CLI calls were bounded with timeout. The default RMW was rmw_fastrtps_cpp on all three distros. rmw_cyclonedds_cpp isn't in these images, so the script installed it with apt for the RMW cases. The baseline worked everywhere: a spinning server, a matching name and type, and ros2 service call got success=True back in 0.48 to 2.07 s, including Python start-up.

It never times out by itself

With no server at all, ros2 service call printed one line and then nothing:

$ timeout 30 ros2 service call /trigger std_srvs/srv/Trigger
waiting for service to become available...
failed to check service availability: rcl node's context is invalid, at ./src/rcl/node.c:428

The second line only appears when the process is being shut down. A 10-second run printed the "waiting" line exactly once on every distro.

Exit codes, measured with timeout --preserve-status so I got the code of ros2 itself:

  • SIGINT (what Ctrl-C sends): exit 2, with no traceback.
  • SIGTERM: exit 1, after the rcl node's context is invalid line.
  • Plain timeout 30: exit 124. That's timeout's own code for "I had to stop it".

The line number in that message was node.c:428 on Humble, node.c:404 on Jazzy and node.c:409 on Lyrical. Drop it when you search.

Lyrical's ros2 service call has a --timeout N option. Humble's and Jazzy's help lists only -r (and --stdin on Jazzy). The help text says "Maximum time to wait for service response in seconds", and that is all it covers. With no server, --timeout 3 still waited until my 30 s timeout killed it. Against a server that never spins, it gave up after 3 s:

waiting for service to become available...
requester: making request: std_srvs.srv.Trigger_Request()

Timed out waiting for response from service /trigger (timeout: 3.0s)

That run exited with 1 after 3.82 s. In scripts on any distro, wrap the call yourself: timeout 10 ros2 service call ....

Name, namespace and remap

The client's name has to resolve to exactly the name the server registered. Three ways to miss it:

  • Wrong name. A server on /add_trigger doesn't answer /trigger. ros2 service list -t shows the real name.
  • Namespace. A server started with --ros-args -r __ns:=/robot1 that creates a service with the relative name trigger ends up at /robot1/trigger. A call to /trigger waits forever, and a call to /robot1/trigger worked in 0.48 to 0.84 s. The client side follows the same rule. A Python client inside /robot1 that asked for the relative name trigger found the server (True after 0.25 to 1.50 s). The same client asking for /trigger got False after 3.00 s. If the server uses an absolute name, /trigger, the namespace doesn't apply, and a call to /trigger worked.
  • Remap. --ros-args -r trigger:=trigger_v2 on the server moved the service to /trigger_v2, for both the Python and the C++ server. ros2 node info on the server node shows it.

In all three cases ros2 service type /trigger printed nothing and exited with 1, which is easy to check in a script.

A wrong type waits, it doesn't fail

I put a std_srvs/srv/SetBool server on /trigger and called it with std_srvs/srv/Trigger. The CLI didn't print a type error. It showed the same "waiting for service to become available..." and waited, on all three distros. wait_for_service returned False after 3.00 s in both client libraries. A service only matches when the name and the type both match. With the right type the call worked:

ros2 service call /trigger std_srvs/srv/SetBool "{data: true}"

A type that doesn't exist at all fails right away, in 0.33 to 0.43 s with exit 1:

$ ros2 service call /trigger std_srvs/srv/Trigge
The passed service type is invalid

So ros2 service list -t is better than plain ros2 service list. The type in brackets is the one to copy.

Different ROS_DOMAIN_ID

With the server in domain 7 and the client in the default domain, the client side saw nothing. ros2 service list -t was empty, ros2 node list was empty, and the call waited. Running the same commands with ROS_DOMAIN_ID=7 showed /trigger [std_srvs/srv/Trigger], and the call returned in 0.73 to 3.05 s. An empty ros2 node list while you know the server is running points to the domain, or to discovery in general. If the two sides are on different machines or containers, see ROS 2 nodes can't see each other. I tested only one container here.

The server exists but never spins

A node that calls create_service and then sleeps, or blocks in a callback, never runs the executor. Discovery doesn't need the executor, so the service looks fine everywhere. ros2 service list -t, ros2 service type and ros2 node info all showed /trigger: std_srvs/srv/Trigger. wait_for_service returned True after 0.00 to 2.42 s. The CLI printed the request and then hung:

requester: making request: std_srvs.srv.Trigger_Request()

The fix is on the server side. Call rclpy.spin(node) or rclcpp::spin(node), or add the node to an executor that is spinning. And don't block the thread that spins.

If the server is an rclpy node that seems stuck in a loop, see rclpy rate.sleep() blocks forever: why and how to fix.

Different RMW between server and client

I ran the server on rmw_cyclonedds_cpp and the client on the default rmw_fastrtps_cpp, then the other way round. Both clients found the service. wait_for_service returned True in both libraries. No reply ever came back. The CLI hung after requester: making request, and the C++ client logged no response within 5s. The graph tools didn't agree with each other either. In one run ros2 service list -t was empty while ros2 service type /trigger printed the type. In another the list showed the service and service type exited with 1. In the reversed case ros2 node list was empty while the service was listed. With both sides on rmw_cyclonedds_cpp, the call worked in 0.54 to 0.65 s. Put the same RMW_IMPLEMENTATION on every process.

On one Lyrical run in this mixed setup, ros2 service call didn't exit when timeout sent it SIGTERM. It was still there 16 minutes later, and the Cyclone DDS server's main thread was at about 99% CPU. I killed it with SIGKILL. The reversed case in the same Lyrical run, and this case on Humble and Jazzy, ended normally after 15 s. Use timeout -k 5 ... if you script this. The host-side capture is at the end of out_lyrical.txt.

A server that already exited, and the daemon

After a clean SIGTERM, /trigger was gone from ros2 service list 2 s later, both through the daemon and with --no-daemon. After SIGKILL it was different. The daemon kept listing /trigger at 1, 5 and 15 s, and only dropped it by 30 s. --no-daemon showed nothing at all of those times. ros2 service call waited at "waiting for service to become available..." the whole time, so the stale entry didn't fool the call. It only fooled the listing. ros2 daemon stop cleared it right away.

ros2 daemon stop did nothing for the real causes. With the domain mismatch and with the wrong name, I stopped the daemon and the call waited exactly as before (8.24 to 8.40 s until timeout). One more thing: on Jazzy and Lyrical, the first ros2 service list right after the daemon was stopped printed nothing once, although the server was running. If the list is empty and you don't believe it, run it again or add --no-daemon.

How long discovery takes

A client that waits is fine as long as the server shows up. When I started ros2 service call 4 s before the server, it printed "waiting" once, then got its answer, after 4.98 to 5.33 s in total. To measure the delay, I started a Python client that polls wait_for_service, waited 3 s, then started a server. Five runs per server per distro, all in one container:

Distro Python server: process start to seen C++ server: process start to seen Service created to seen (both)
Humble 0.57 to 0.58 s 0.33 s 0.17 to 0.25 s
Jazzy 0.48 to 0.66 s 0.41 to 0.42 s 0.06 to 0.25 s
Lyrical 0.75 s 0.49 to 0.73 s 0.05 to 0.25 s

Most of the delay is process start-up. A fresh client against a server that was already running: 8 runs per library per distro, and every wait_for_service(3s) returned True. Python took 0.00 to 0.50 s, in rclpy's 0.25 s polling steps. So a timeout of a few seconds is enough on one host. If it fails every time, the cause is in the table above, not discovery speed.

A client that tells you what is wrong

A bare while not cli.wait_for_service(): pass hangs as quietly as the CLI. This loop gives up after a fixed time and says why. It also bounds the wait for the response, which catches the "found but no reply" group:

for i in range(10):
    if cli.wait_for_service(timeout_sec=1.0):
        break
    node.get_logger().warning(f'{cli.srv_name} not available after {i+1}s, still waiting (check ros2 service list -t)')
else:
    node.get_logger().error(f'gave up on {cli.srv_name}')
    raise SystemExit(2)
fut = cli.call_async(Trigger.Request())
rclpy.spin_until_future_complete(node, fut, timeout_sec=5.0)
if not fut.done():
    node.get_logger().error(f'{cli.srv_name} is available but sent no response within 5s')
    raise SystemExit(3)

With no server it logged one warning per second and exited with 2. With a server that never spins it got past the wait at once and exited with 3 after 5 s. Use warning, not warn. On Lyrical, log.warn raised AttributeError: 'RcutilsLogger' object has no attribute 'warn'. Humble and Jazzy accepted it. The C++ client in repro.sh does the same with wait_for_service and spin_until_future_complete(node, f, std::chrono::seconds(5)).

Fix options compared

Fix Helps with Measured effect
Copy the name and type from ros2 service list -t wrong name, namespace, remap, type call worked in every such case
Same ROS_DOMAIN_ID on both sides domain mismatch call worked in 0.73 to 3.05 s
Same RMW_IMPLEMENTATION on both sides found but no reply both on Cyclone: 0.54 to 0.65 s
Spin the server found but no reply baseline: 0.48 to 2.07 s
ros2 daemon stop stale entries in ros2 service list after a crash no change for any cause that made the call wait
timeout N ros2 service call ... scripts that must not hang exit 124 after N s; add -k for the rare case that ignores SIGTERM
--timeout N (Lyrical only) server found but slow or stuck gave up after 3 s; did not limit the wait for discovery

Version notes

The cause-by-cause behavior was the same on Humble, Jazzy and Lyrical. The differences I saw: only Lyrical's ros2 service call has --timeout and the --qos-* options. Jazzy and Lyrical list a /wsvc_server/get_type_description service for every node, and Humble doesn't. Lyrical's rclpy logger has no warn method. The C++ server was seen about 0.25 s sooner than the Python server on every distro (median of five runs).

Not tested

Clients and servers on different machines or in different containers, ROS_LOCALHOST_ONLY and ROS_AUTOMATIC_DISCOVERY_RANGE, Zenoh and other RMWs, incompatible service QoS (ros2cli issue 818), services inside launch files or component containers, lifecycle nodes, a callback that deadlocks inside an otherwise spinning node, actions, Foxy, Iron and Rolling.

FAQ

Why does ros2 service call say waiting for service to become available forever?

It can't find a server with that name and type in its domain, and it has no time limit. In my runs that happened with a wrong name, a missing namespace, a remapped server, a different type, a different ROS_DOMAIN_ID, and a server that had exited. Compare your call with ros2 service list -t.

The service shows in ros2 service list but the call still hangs. Why?

Check the type in ros2 service list -t. A different type waits the same way. If the CLI got as far as requester: making request, the server was found but didn't answer. That happened when the server never spun and when the server and client used different RMW implementations.

Does ros2 service call have a timeout?

Not on Humble or Jazzy. Lyrical has --timeout N, but it only limits the wait for the response. It didn't stop the wait for a missing service. Wrap the command in timeout N on any distro.

Why does wait_for_service return False?

For the same reasons the CLI waits. In rclpy it returned False after exactly the timeout you give it. A real server on the same host was found in 0.00 to 0.50 s, so a False after a few seconds means a name, type, domain or RMW problem, not slow discovery.

Does ros2 daemon stop fix it?

Only the listing. After a server was killed with SIGKILL, the daemon kept showing the dead service for at least 15 s, and ros2 daemon stop cleared that. It didn't change the result of any call that was waiting.

Measured on 2026-10-31 with ros:humble-ros-base (sha256:d9bcf2e6f72d..., rclpy 3.3.22, rclcpp 16.0.21, ros2cli 0.18.20, rmw_fastrtps_cpp 6.2.10, rmw_cyclonedds_cpp 1.3.5), ros:jazzy-ros-base (sha256:8eed0a4669bb..., rclpy 7.1.12, rclcpp 28.1.22, ros2cli 0.32.13, rmw_fastrtps_cpp 8.4.4, rmw_cyclonedds_cpp 2.2.4) and ros:lyrical-ros-base (sha256:3224ee150cb0..., rclpy 10.0.11, rclcpp 32.0.3, ros2cli 0.40.9, rmw_fastrtps_cpp 9.4.10, rmw_cyclonedds_cpp 4.1.5). The default RMW was Fast DDS on all three. Full digests and versions are in digests.txt.

Script and raw output: evidence folder. Questions this answers: [ROS2] Service call keeps waiting for the service to be available, Service callback in ros2 Python is not firing, Add configurable timeout for service calls to prevent command from hanging indefinitely, ros2 service call waits forever if QoS is incompatible with concerned server, wait_for_service discovery fails if multiple nodes wait for the same service.