You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: kraken: Router error wrappers answer HTTP 500 and write no log line #4883
Four router wrappers turn any unexpected error into HTTP 500 and write nothing to the Kraken log. The client gets only str(error). The traceback is lost. A maintainer who reads a bug report cannot find the cause in the logs.
Root cause: one wrapper, copied four times, ends with except Exception and a raise HTTPException(500). None of the four calls logger.exception:
Fix: call logger.exception with the route before each of the four 500 raises. The error stays visible to the client.
Steps to reproduce
Run the real router with an endpoint that raises RuntimeError("boom"), for example ContainerManager.get_running_containers faked. (from code reading, not run)
Call the endpoint.
The client gets HTTP 500 with detail boom. The Kraken log has no line and no traceback.
Primary pain point(s)
A user or maintainer cannot see why a Kraken call failed. Workaround: none known.
Additional context
Environment: code reading only. Code: bluerobotics/BlueOS 1.4-dev at fa7614a (measured). Board, OS and browser: not used.
Found by the swallowed-errors audit of Kraken (rule: no code path swallows an error). Duplicate check (gh issue list and gh pr list, state all): "swallow error kraken", "router 500 log". No issue covers it.
Evidence
Audit: DEV/efforts/kraken-4313/swallowed-errors-audit.md, rows 1 to 4. Rows 5 (tar upload logs then raises) is allowed.
Activity