Skip to content

Transient inconsitency in in-memory values causes a HTTP 500 error #193

@benoit74

Description

@benoit74
1772496185222	2026-03-03T00:03:05.222Z	INFO:     73.133.114.154:0 - "GET /api/v1/requests/b93ed938-6cc9-4284-b0d8-f4c69b888662 HTTP/1.1" 200 OK
1772496185330	2026-03-03T00:03:05.330Z	INFO:     73.133.114.154:0 - "GET /api/v1/requests/b93ed938-6cc9-4284-b0d8-f4c69b888662 HTTP/1.1" 200 OK
1772496185334	2026-03-03T00:03:05.334Z	INFO:     73.133.114.154:0 - "POST /api/v1/tracker_status HTTP/1.1" 200 OK
1772496185336	2026-03-03T00:03:05.336Z	ERROR: list.remove(x): x not in list
1772496185336	2026-03-03T00:03:05.336Z	Traceback (most recent call last):
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
1772496185336	2026-03-03T00:03:05.336Z	    await self.app(scope, receive, _send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
1772496185336	2026-03-03T00:03:05.336Z	    await self.simple_response(scope, receive, send, request_headers=headers)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 144, in simple_response
1772496185336	2026-03-03T00:03:05.336Z	    await self.app(scope, receive, send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
1772496185336	2026-03-03T00:03:05.336Z	    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
1772496185336	2026-03-03T00:03:05.336Z	    raise exc
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
1772496185336	2026-03-03T00:03:05.336Z	    await app(scope, receive, sender)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
1772496185336	2026-03-03T00:03:05.336Z	    await self.middleware_stack(scope, receive, send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
1772496185336	2026-03-03T00:03:05.336Z	    await route.handle(scope, receive, send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
1772496185336	2026-03-03T00:03:05.336Z	    await self.app(scope, receive, send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
1772496185336	2026-03-03T00:03:05.336Z	    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
1772496185336	2026-03-03T00:03:05.336Z	    raise exc
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
1772496185336	2026-03-03T00:03:05.336Z	    await app(scope, receive, sender)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
1772496185336	2026-03-03T00:03:05.336Z	    response = await f(request)
1772496185336	2026-03-03T00:03:05.336Z	               ^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
1772496185336	2026-03-03T00:03:05.336Z	    raw_response = await run_endpoint_function(
1772496185336	2026-03-03T00:03:05.336Z	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 214, in run_endpoint_function
1772496185336	2026-03-03T00:03:05.336Z	    return await run_in_threadpool(dependant.call, **values)
1772496185336	2026-03-03T00:03:05.336Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/starlette/concurrency.py", line 39, in run_in_threadpool
1772496185336	2026-03-03T00:03:05.336Z	    return await anyio.to_thread.run_sync(func, *args)
1772496185336	2026-03-03T00:03:05.336Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/anyio/to_thread.py", line 63, in run_sync
1772496185336	2026-03-03T00:03:05.336Z	    return await get_async_backend().run_sync_in_worker_thread(
1772496185336	2026-03-03T00:03:05.336Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2502, in run_sync_in_worker_thread
1772496185336	2026-03-03T00:03:05.336Z	    return await future
1772496185336	2026-03-03T00:03:05.336Z	           ^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 986, in run
1772496185336	2026-03-03T00:03:05.336Z	    result = context.run(func, *args)
1772496185336	2026-03-03T00:03:05.336Z	             ^^^^^^^^^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/zimitfrontend/routes/tracker.py", line 34, in post_tracker_status
1772496185336	2026-03-03T00:03:05.336Z	    tracker_status = tracker.add_task(
1772496185336	2026-03-03T00:03:05.336Z	                     ^^^^^^^^^^^^^^^^^
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/zimitfrontend/tracker.py", line 118, in add_task
1772496185336	2026-03-03T00:03:05.336Z	    self._refresh_ongoing_tasks(ip_address, unique_id)
1772496185336	2026-03-03T00:03:05.336Z	  File "/usr/local/lib/python3.12/site-packages/zimitfrontend/tracker.py", line 77, in _refresh_ongoing_tasks
1772496185336	2026-03-03T00:03:05.336Z	    client.ongoing_tasks.remove(task)
1772496185336	2026-03-03T00:03:05.336Z	ValueError: list.remove(x): x not in list
1772496185336	2026-03-03T00:03:05.336Z	INFO:     73.133.114.154:0 - "POST /api/v1/tracker_status HTTP/1.1" 500 Internal Server Error
1772496185338	2026-03-03T00:03:05.338Z	ERROR:    Exception in ASGI application
1772496185338	2026-03-03T00:03:05.338Z	Traceback (most recent call last):
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 416, in run_asgi
1772496185338	2026-03-03T00:03:05.338Z	    result = await app(  # type: ignore[func-returns-value]
1772496185338	2026-03-03T00:03:05.338Z	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    return await self.app(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await super().__call__(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.middleware_stack(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    raise exc
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.app(scope, receive, _send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
1772496185338	2026-03-03T00:03:05.338Z	    raise exc
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
1772496185338	2026-03-03T00:03:05.338Z	    await app(scope, receive, sender)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.middleware_stack(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
1772496185338	2026-03-03T00:03:05.338Z	    await route.handle(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 460, in handle
1772496185338	2026-03-03T00:03:05.338Z	    await self.app(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await super().__call__(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.middleware_stack(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    raise exc
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.app(scope, receive, _send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.simple_response(scope, receive, send, request_headers=headers)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 144, in simple_response
1772496185338	2026-03-03T00:03:05.338Z	    await self.app(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
1772496185338	2026-03-03T00:03:05.338Z	    raise exc
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
1772496185338	2026-03-03T00:03:05.338Z	    await app(scope, receive, sender)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
1772496185338	2026-03-03T00:03:05.338Z	    await self.middleware_stack(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
1772496185338	2026-03-03T00:03:05.338Z	    await route.handle(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
1772496185338	2026-03-03T00:03:05.338Z	    await self.app(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
1772496185338	2026-03-03T00:03:05.338Z	    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
1772496185338	2026-03-03T00:03:05.338Z	    raise exc
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
1772496185338	2026-03-03T00:03:05.338Z	    await app(scope, receive, sender)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
1772496185338	2026-03-03T00:03:05.338Z	    response = await f(request)
1772496185338	2026-03-03T00:03:05.338Z	               ^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
1772496185338	2026-03-03T00:03:05.338Z	    raw_response = await run_endpoint_function(
1772496185338	2026-03-03T00:03:05.338Z	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 214, in run_endpoint_function
1772496185338	2026-03-03T00:03:05.338Z	    return await run_in_threadpool(dependant.call, **values)
1772496185338	2026-03-03T00:03:05.338Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/starlette/concurrency.py", line 39, in run_in_threadpool
1772496185338	2026-03-03T00:03:05.338Z	    return await anyio.to_thread.run_sync(func, *args)
1772496185338	2026-03-03T00:03:05.338Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/anyio/to_thread.py", line 63, in run_sync
1772496185338	2026-03-03T00:03:05.338Z	    return await get_async_backend().run_sync_in_worker_thread(
1772496185338	2026-03-03T00:03:05.338Z	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2502, in run_sync_in_worker_thread
1772496185338	2026-03-03T00:03:05.338Z	    return await future
1772496185338	2026-03-03T00:03:05.338Z	           ^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 986, in run
1772496185338	2026-03-03T00:03:05.338Z	    result = context.run(func, *args)
1772496185338	2026-03-03T00:03:05.338Z	             ^^^^^^^^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/zimitfrontend/routes/tracker.py", line 34, in post_tracker_status
1772496185338	2026-03-03T00:03:05.338Z	    tracker_status = tracker.add_task(
1772496185338	2026-03-03T00:03:05.338Z	                     ^^^^^^^^^^^^^^^^^
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/zimitfrontend/tracker.py", line 118, in add_task
1772496185338	2026-03-03T00:03:05.338Z	    self._refresh_ongoing_tasks(ip_address, unique_id)
1772496185338	2026-03-03T00:03:05.338Z	  File "/usr/local/lib/python3.12/site-packages/zimitfrontend/tracker.py", line 77, in _refresh_ongoing_tasks
1772496185338	2026-03-03T00:03:05.338Z	    client.ongoing_tasks.remove(task)
1772496185338	2026-03-03T00:03:05.338Z	ValueError: list.remove(x): x not in list
1772496186159	2026-03-03T00:03:06.159Z	INFO:     108.28.25.49:0 - "POST /api/v1/tracker_status HTTP/1.1" 200 OK
1772496186215	2026-03-03T00:03:06.215Z	INFO:     108.28.25.49:0 - "GET /api/v1/requests/837a19ac-8cde-455a-96da-ca2fca4cdeac HTTP/1.1" 200 OK

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions