Job-log ids are ambiguous across namespaces: a wrong id returns someone else's log instead of 404 #248
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fj run view --log-failedworks now (thank you, #239), but two adjacent things make log retrieval unreliable, and both cost real diagnosis time today.1.
runs/{id}/jobsjob ids do not address the log endpointThat is not the job I asked for; it is some other job from eight weeks earlier. The same thing happened with an id taken from
actions/tasks(35574returned an August 4 log for a different PR, and35745returned an August 5 Forseti run on PR #1097).So there appear to be at least three id namespaces in play, and an id from one of them silently returns a valid-looking log from another rather than 404ing. That is the dangerous part: the response looks like a successful retrieval, and the only tell is the timestamp being days or weeks off. I built a false picture from one of these before noticing the date.
If fj is going to expose job logs, it would help enormously for it to resolve the id itself and refuse a cross-namespace hit, rather than callers guessing which number to use.
2.
--log-failedgives up on some runsRun 5399 does contain a failed job (
db-tests, id 12599 per the jobs endpoint), so "No matching jobs" is wrong rather than merely unhelpful. Run 5400's failure is a different path again.Why this matters more than it looks
fleet#267 took nine occurrences and several agent sessions to root-cause, and the single biggest reason was that nobody could reliably read what a failing CI job actually did. Once
fj run view --log-failedworked, it took minutes to pin the exact line. Anything that makes log retrieval ambiguous puts us back in that state, and a wrong-but-plausible log is worse than an error, because it gets believed.Reproduced on fj built from
maintoday (post #239, #242, #247) on usw-dev-01.