diff --git a/src/calng/CalibrationManager.py b/src/calng/CalibrationManager.py
index 78523ca665d850950d7da8997031388648f73dc3..732a847e3ca31f43c541a95e9f6af51a99bbcb34 100644
--- a/src/calng/CalibrationManager.py
+++ b/src/calng/CalibrationManager.py
@@ -1074,7 +1074,7 @@ class CalibrationManager(DeviceClientBase, Device):
         # need are in there, and obtain their API names.
         for host, req_names in hosts.items():
             # Retrieve hostname for nice error messages.
-            hostname = urlparse(self._server_hosts[name]).hostname
+            hostname = urlparse(host).hostname
 
             try:
                 reply = await to_asyncio_future(self._http_client.fetch(