Repository navigation
Description
What happened
Two tasks failed inside the container (exit 1 from the user command, cause in #565). Neither ever produced a completion record, and neither box self-terminated on failure — both sat until TTL.
Measured, cookbook-salmon-quant-r1, spawn 0.102.0 / 3db242c, AL2023 arm64 c8g.2xlarge:
| time (UTC) | event |
|---|---|
| 17:31:51 | instance launched, TTL 20m, on_complete: terminate |
| 17:32:50 | container starts; inputs verify; user command exits 1 |
| 17:51:51 | TTL elapses |
| ~17:52 | instance terminated by TTL |
| — | s3://spawn-results-…/tasks/cookbook-salmon-quant-r1/ — prefix never created |
Checked repeatedly across those 20 minutes: no completion.json, no .exitcode, no command.log, no prefix at all. Same for the sibling task cookbook-star-align-r1 (still running toward its 30m TTL as I write this).
The five tasks in the same batch whose commands succeeded all wrote their records and self-terminated within a minute of finishing, so this is specific to the failure path.
Why this contradicts the intended design
pkg/taskproto/wrapper.go is explicit that the failure path is supposed to be covered:
wrapper.go:25-27— "We do NOTset -e. Under -e the script would abort the instant the user command exits non-zero, so stage-out and the completion record would never run — defeating the purpose."wrapper.go:64— emits that same note into the script.wrapper.go:112— "stage-out (only when the command actually ran; runs even if it failed)".wrapper.go:126-132— classification explicitly has anelif [ "$rc" -ne 0 ]branch settingSTATE='failed'/RETRY_CLASS=app_error.wrapper.go:154,:158—completion.jsonand.exitcodecopied with|| true.wrapper.go:166—/tmp/SPAWN_COMPLETEwritten with"status": "$STATE", which is what driveson_complete.
So a failing command should produce state: failed, exit_code: 1, retry_class: app_error and self-terminate. Observed: neither. The wrapper appears not to reach the block after writeContainerRun's rc=$?. Console output stops at the container teardown with no aws s3 cp output following, which is consistent with that but is not proof — the serial console capture may simply not carry it.
I have not instrumented further: from outside the box I can only observe absence, and guessing at the mechanism is your call to make with a log in hand.
Impact, in order
- A failed task is indistinguishable from a stage-in failure. Both present as "no completion record." The docs and my own project rules say no-record means probable stage-in failure; that heuristic is now wrong, and there's no way to tell them apart from S3.
--waitburns the entire TTL on a task that failed in the first minute. It reports correctly when it gives up —timed out waiting for task "…" completion record (past TTL); poll later with 'spawn task status …', exit 1 — but that arrives 19 minutes after the answer was knowable.- Spend. 20 min billed for 60 s of work, ×3 boxes here. Bounded, not stranded — TTL fired reliably, which is the part that works and is worth keeping.
retry_class: app_errornever reaches anything that consumes it, so a caller cannot distinguish retryable from not.
This is the counterpart to #561: there, a task with a missing output is recorded completed / exit_code: 0 (a green check over nothing); here, a task with a failing command is recorded as nothing at all. Together they mean the completion record cannot currently be trusted in either direction on the failure path.
What would settle it
A bash -x of the generated wrapper around the writeContainerRun boundary on a task whose command exits non-zero on purpose — e.g. command: ["bash","-c","exit 3"] with one declared output. That should be a two-minute reproduction and does not need a real payload.
Filed from the scientific-codes-cookbook project.
Activity
scttfrdmn commentedon Sep 3, 2026
Second sighting, and it widens the finding
A third task hit the same signature, but failed at a different place, which is the part that matters.
cookbook-salmon-quant-r1, retry, spawn 0.102.0 /3db242c,c8g.2xlarge, TTL 20m:spored installation completednf install docker, nodocker pull, no wrapper output at allspawn task status cookbook-salmon-quant-r1→running (no completion record yet)tasks/cookbook-salmon-quant-r1/— prefix never createdConsole output on this box carries kernel/audit lines through 334s, so the console was capturing; the wrapper's own output simply never appears. On the two earlier boxes the same console did carry
dnf install,docker pulland the task's stdout, so this is not a capture artifact. The task script appears never to have started.An identical-shape sibling task (
cookbook-star-align-r1, same edit, same image family, launched 40s later) ran clean and wrote its record, so this is not the spec.Why this widens it rather than just confirming it
The original report was "a task whose command fails writes no record." This box's command never ran. So the missing-record signature now covers at least three distinct failure locations:
retry_class: staging_error)All three present identically from the outside: no
completion.json, no.exitcode, nocommand.log, no prefix,statusreportingrunning, box riding to TTL. The absence of a completion record therefore carries no diagnostic information whatsoever — it cannot distinguish "never started" from "failed" from "still working." That is a stronger claim than the original issue made, and it is what makes--waitexpensive: 21.6 minutes billed here for a box that did nothing after second 27.Also worth separating out:
spawn task statusreportingrunningfor a box that has produced nothing for 11 minutes is reporting intent, not observed state. Something cheap that reflects reality — instance still alive vs. wrapper heartbeat vs. no signal since T — would let a caller give up early instead of paying out the TTL. Happy to file that separately if you'd rather keep this issue scoped to the record itself.TTL fired reliably in all three cases, so spend stayed bounded. That part continues to work.
scttfrdmn commentedon Sep 3, 2026
Naming the pattern, since this is now the third instance in the same family. Not a new report — recording it here so a fourth sighting has something to attach to.
All three are spec-and-status handling that reports success or silence instead of the truth, and none of them are in the launch path:
state: completed, exit_code: 0. The wrapper computes the stage-out result and discards it. Green check over a missing object.spawn task statusreportingrunningfor an idle box: intent, not observed state.8a2f45d:resources.disk_gibandlifecycle.cost_limitdid not exist as TaskSpec fields, andParseSpecdiscarded unknown keys silently. So a spec requesting a larger root disk or a cost cap parsed clean, passedValidate(), and launched with neither — silent on both. TheDisallowUnknownFieldsfix is the right shape precisely because it converts a silent narrowing into a parse error.The shared root cause is that the TaskSpec/status surface treats "I could not do what you asked" as a non-event, while the launch path generally errors. The fix shape that worked for #558 — make the discrepancy loud at parse or record time rather than inferable afterwards — is probably the fix shape for #561 too: stage-out failure should set the state, not be discarded.
No action requested beyond #566 itself. Flagging the family because two of the three cost a box to discover, and the diagnostic path for all three was "read the console output," which is not something a caller can automate against.
fix(taskproto): lost outputs and failing commands both lose their com…
scttfrdmn commentedon Sep 4, 2026
Fourth sighting, and I think there's a fix that closes the class rather than the instance
Filed #570 today for an unrelated reason (a container task can't see a mounted EFS) and its secondary finding belongs here instead, because it's this pattern again:
{"inputs": [{"source": "/efs/refs/GRCh38.fa", "destination": "/tmp/GRCh38.fa"}]}Validaterequires only that both fields are non-empty (pkg/taskproto/taskspec.go:203–207), and the wrapper emitsaws s3 cpunconditionally (wrapper.go:117,:173). So that spec parses, validates, passes--dry-run, launches, boots, installs Docker, and only then dies in stage-in onParamValidation: usage: aws s3 cp <LocalPath> <S3Uri> .... Since #558 addedDisallowUnknownFieldsthis isn't even a dropped unknown key — it's a known field holding a value nothing downstream can execute.The family, as I read it
Two distinct axes keep getting conflated, and separating them suggests different fixes:
Axis A — the spec was knowably wrong before the instance existed, and you pay a boot to find out.
disk_gib/cost_limitsilently droppeds3://manifest entryAxis B — the task ran and the record lies about it.
completed,exit_code: 0Axis B needs the wrapper/record fix this issue is about. But Axis A is entirely a validation problem, and it's the cheaper half: every instance of it is a
Validatethat accepts a value no downstream consumer can act on.Concretely
Validatealready does exactly the right thing in one place:—
taskspec.go:213–217That's the pattern.
Inputs/Outputsshould have the same check on their S3 side (whichever side that is), and it'd be worth auditingValidateonce against the wholeTaskSpecfor other fields where "non-empty" is standing in for "actually usable" — a field that validates but can't execute is a boot's worth of money each time someone believes it.I'd guess that audit is a short afternoon and retires Axis A permanently, which is the difference between fixing four bugs and fixing the reason there were four.
On this issue's own repro
Also worth noting for whoever picks up the
bash -xreproduction suggested above: #570's secondary finding is a cheaper trigger for the same instrumentation, because stage-in failure and command failure take different branches (STAGE_RCvsrc), and a bad manifest source fails before Docker is even installed. If the two paths turn out to produce the same "no record at all" symptom, that's a useful narrowing; if only one does, that localizes it.Filed from the scientific-codes-cookbook project. Related: #570, #571.
feat(taskproto): add phase-timestamp markers to the wrapper log (#571) (
scttfrdmn commentedon Sep 5, 2026
Fixed by #567, shipped in v0.104.0.