Skip to content

core: kraken: Router error wrappers answer HTTP 500 and write no log line #4883

Todo

Description

@joaoantoniocardoso

Bug description

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

  1. Run the real router with an endpoint that raises RuntimeError("boom"), for example ContainerManager.get_running_containers faked. (from code reading, not run)
  2. Call the endpoint.
  3. 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

  1. added
    bug
    core
    triage
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcorekrakentriage

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions