Skip to content

A 500 from GET /api/v1/packages (and /meta/package/:name) leaves no server-side log line at all #14310

Description

@hotlong

What happens

While the packages endpoints were answering 500 (the circular-JSON failure filed alongside this issue), the dev server printed nothing: preview_logs / stdout at the default log level showed no error, no stack, no request line. The only evidence was the client-side console (Failed to load resource: 500) and the response body itself.

Measured on main @ a39b02a, showcase, objectstack dev --seed-admin -p 3911, three consecutive GET /api/v1/packages from Studio plus manual curl reproductions, all 500, zero log output.

Why it matters

Route & surface ownership §3: absence must be loud. A 5xx that is invisible to the operator is diagnosed from the browser or not at all; here the failure had been reachable since #12348 landed (2026-08-25) and nobody saw it because nothing was logged.

Expected

Every 5xx produced by the REST layer's error envelope (packages/rest/src/error-response.ts / the direct-mount package routes' catch blocks, and the runtime dispatcher's errorFromThrown) logs at error level with method, path, request id and the thrown error's message + stack, regardless of --log-level's default. 4xx may stay quiet; 5xx never.

Suggested fix

  • Centralize: the place that turns a thrown error into a 500 envelope logs it once (avoid double logging where both the package routes and the dispatcher catch).
  • Add a test that a handler throwing a plain Error yields a 500 and an error-level log entry carrying the message.

Found during the objectui pin-bump dogfood (PR #14295).

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:clipriority:p1High: required for production / M2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions