A request to a path that matches no route exits 60 and prints zero bytes on both stdout and stderr. There is no way to tell a routing miss from a successful empty response.
Repro
$ sentry api /api/0/definitely-not-real/ ; echo "exit=$?"
exit=60
$ sentry api /api/0/issues/7670740039/committers/ 2>&1 | wc -c
0
Compare a 404 that does carry a JSON body — this one is reported correctly:
$ sentry api /api/0/issues/99999999999/
{
"detail": "The requested resource does not exist"
}
Cause
Sentry returns two kinds of 404. When a route matches but the object is missing, DRF returns {"detail": ...} and the CLI prints it. When no route matches at all, Django returns an empty body, and the CLI prints nothing — it appears to render the response body without falling back to the status code when that body is empty.
Expected
Any non-2xx should print something on stderr, at minimum the status code and the requested URL. e.g.
error: 404 Not Found — GET /api/0/issues/7670740039/committers/
Why it matters
sentry api is the documented escape hatch for endpoints without a dedicated command, so it is used with paths that are guessed. A silent failure reads as "the endpoint exists and returned nothing", which is the opposite of the truth. I lost real time to this while looking for the committers endpoint — the issue-level path 404s silently, and the actual route is event-level (/projects/{org}/{proj}/events/{event_id}/committers/).
Version
0.43.0-dev.1786559401, behaviour confirmed against origin/main @ 47ad7e4.
A request to a path that matches no route exits
60and prints zero bytes on both stdout and stderr. There is no way to tell a routing miss from a successful empty response.Repro
Compare a 404 that does carry a JSON body — this one is reported correctly:
Cause
Sentry returns two kinds of 404. When a route matches but the object is missing, DRF returns
{"detail": ...}and the CLI prints it. When no route matches at all, Django returns an empty body, and the CLI prints nothing — it appears to render the response body without falling back to the status code when that body is empty.Expected
Any non-2xx should print something on stderr, at minimum the status code and the requested URL. e.g.
Why it matters
sentry apiis the documented escape hatch for endpoints without a dedicated command, so it is used with paths that are guessed. A silent failure reads as "the endpoint exists and returned nothing", which is the opposite of the truth. I lost real time to this while looking for the committers endpoint — the issue-level path 404s silently, and the actual route is event-level (/projects/{org}/{proj}/events/{event_id}/committers/).Version
0.43.0-dev.1786559401, behaviour confirmed againstorigin/main@ 47ad7e4.