Running BlueAPI with NumTracker not running causes error difficult to diagnose
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza por blueapi/utils/numtracker.py, especialmente por create_scan, y sigue su uso desde blueapi/core/context.py en el traceback. Reproduce el escaneo cuando NumTracker no esté disponible e inspecciona el manejo de errores existente; se considera terminado cuando el fallo identifica claramente NumTracker y el problema de conexión relevante, preservando al mismo tiempo el comportamiento existente cuando el servicio está disponible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When trying to run blueapi locally using the following configuration
api:
url: http://0.0.0.0:8000
env:
metadata:
instrument: i06
sources:
- kind: deviceManager
module: dodal.beamlines.i06_1
mock: True
- kind: planFunctions
module: dodal.plans
- kind: planFunctions
module: dodal.plan_stubs.wrapped
stomp:
enabled: true
url: tcp://localhost:61613/
numtracker:
url: http://localhost:8406/graphql
uv run blueapi -c /path/to/blueapi_source.yaml serve
And then running this with blueapi python client, when trying to run a plan such as moving a device it runs okay. However, when trying to run a scan, an error occurs that is not obvious what is causing it.
Client side
>>> pl.step_grid_scan([], params=[(scmc.cart.x, [0, 1, 0.1])])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/scratch/bluesky_development/blueapi/src/blueapi/client/client.py", line 159, in __call__
raise PlanFailedError(typ, msg)
blueapi.client.client.PlanFailedError: All connection attempts failed
Server side
2026-08-04 15:43:43,360 INFO blueapi.worker.task_worker Submitting: task_id='ef0c21cc-bdb1-49e4-8851-caad0170ffeb' task=Task(name='step_grid_scan', params={'detectors': [], 'params': [['scmc.cart.x', [0, 1, 0.1]]]}, metadata={'user': 'Unknown', 'instrument_session': 'cm44150-1'}) request_id=None is_complete=False is_pending=True errors=[] outcome=None
2026-08-04 15:43:43,360 INFO blueapi.worker.task_worker Got new task: task_id='ef0c21cc-bdb1-49e4-8851-caad0170ffeb' task=Task(name='step_grid_scan', params={'detectors': [], 'params': [['scmc.cart.x', [0, 1, 0.1]]]}, metadata={'user': 'Unknown', 'instrument_session': 'cm44150-1'}) request_id=None is_complete=False is_pending=True errors=[] outcome=None
2026-08-04 15:43:43,360 INFO blueapi.worker.task Asked to run plan step_grid_scan with {'detectors': [], 'params': [['scmc.cart.x', [0, 1, 0.1]]]} and metadata {'user': 'Unknown', 'instrument_session': 'cm44150-1'} for all runs
2026-08-04 15:43:43,360 INFO bluesky Executing plan <generator object step_grid_scan at 0x7fb259eecf20>
2026-08-04 15:43:43,360 INFO bluesky.RE.state Change state on <bluesky.run_engine.RunEngine object at 0x7fb29bd2fc90> from 'idle' -> 'running'
2026-08-04 15:43:43,362 INFO blueapi.service.main 127.0.0.1:35674 PUT /worker/task 200
2026-08-04 15:43:43,368 ERROR bluesky Run aborted
Traceback (most recent call last):
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
raise exc from None
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
raise exc
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_async/connection.py", line 124, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_backends/auto.py", line 31, in connect_tcp
return await self._backend.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_backends/anyio.py", line 113, in connect_tcp
with map_exceptions(exc_map):
File "/usr/lib64/python3.11/contextlib.py", line 158, in __exit__
self.gen.throw(typ, value, traceback)
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: All connection attempts failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/run_engine.py", line 1616, in _run
msg = self._plan_stack[-1].send(resp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/dodal/plans/wrapped.py", line 509, in step_grid_scan
yield from bp.list_grid_scan(
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/plans.py", line 356, in list_grid_scan
return (yield from scan_nd(detectors, full_cycler, per_step=per_step, md=_md))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/plans.py", line 1168, in scan_nd
return (yield from inner_scan_nd())
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/utils/__init__.py", line 1351, in dec_inner
return (yield from plan)
^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/preprocessors.py", line 1013, in stage_wrapper
return (yield from finalize_wrapper(inner(), unstage_devices()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/preprocessors.py", line 548, in finalize_wrapper
ret = yield from plan
^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/preprocessors.py", line 1011, in inner
return (yield from plan)
^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/utils/__init__.py", line 1351, in dec_inner
return (yield from plan)
^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/preprocessors.py", line 362, in run_wrapper
rs_uid = yield from open_run(md)
^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/utils/__init__.py", line 2047, in __iter__
return (yield from self._iter)
^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/plan_stubs.py", line 1366, in open_run
return (yield Msg("open_run", **(md or {})))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/run_engine.py", line 1683, in _run
new_response = await coro(msg)
^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/run_engine.py", line 1855, in _open_run
self.md["scan_id"] = await maybe_await(self.scan_id_source(self.md))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/bluesky/utils/__init__.py", line 2029, in maybe_await
return await ret
^^^^^^^^^
File "/scratch/bluesky_development/blueapi/src/blueapi/core/context.py", line 159, in _update_scan_num
scan = await numtracker.create_scan(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/src/blueapi/utils/numtracker.py", line 98, in create_scan
response = await client.post(
^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_client.py", line 1859, in post
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_client.py", line 1540, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_client.py", line 1629, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_client.py", line 1730, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib64/python3.11/contextlib.py", line 158, in __exit__
self.gen.throw(typ, value, traceback)
File "/scratch/bluesky_development/blueapi/.venv/lib64/python3.11/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: All connection attempts failed
@tpoliaw managed to help me fix it by commenting out numtracker configuration and then the scan would work again, but this traceback is not obvious at all what is causing the issue. Is it possible we could make the traceback user friendly mentioning num tracker?
- Lenguaje dominante
- Python
- Estrellas
- 13
- Forks
- 14
- Merge medio
- 3 d 34 min
- PR fusionados (30 d)
- 15
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DiamondLightSource/blueapi
-
kwargs: {} gets added to plan **kwargsPosiblemente ocupada @oliwenmandiamond la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DiamondLightSource/blueapi#1719 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
deployment
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DiamondLightSource/blueapi#1626 ·
Los mantenedores suelen responder en 1 día
-
deployment dev-environment
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DiamondLightSource/blueapi#1623 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Cannot Install SoftiocAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DiamondLightSource/blueapi#1605 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
DiamondLightSource/blueapi#1494 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DiamondLightSource/blueapi
Issues similares
-
[oblt-aw][autodoc] Update docs for security org scaffolding and Docs AI menu permission changesPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
external integration integration-submission
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
langchain-ai/docs#7077 ·
Los mantenedores suelen responder en 1 día
-
author-page correction
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
acl-org/acl-anthology#10623 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Use context to recognize personal initials and lowercase namesPosiblemente ocupada @lipikaramaswamy la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
NVIDIA-NeMo/Anonymizer#340 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
btclib-org/btclib-node#2083 ·
Los mantenedores suelen responder en 1 día