Repository navigation
Description
Symptom
spawn task status and spawn task run --wait never find a completion record, even though the record exists, is valid, and is at exactly the path spawn printed at launch. --wait therefore polls until TTL and exits 1 on a task that succeeded in 50 seconds.
spawn 0.121.0, us-west-2.
✅ Task launched: cookbook-polish-align-r2
Instance: i-0297ab55af9f47182 (c8g.large) in us-west-2 / us-west-2b
Run ID: 643c4c73-0b67-46fe-92f8-aae906a0c366
Completion: s3://spawn-results-942542972736-us-west-2/tasks/cookbook-polish-align-r2/completion.json
Waiting for completion (polling every 15s)...
timed out waiting for task "cookbook-polish-align-r2" completion record (past TTL); poll later with 'spawn task status cookbook-polish-align-r2'
[exited with code 1]
The task was fine. All six declared outputs staged, the instance self-terminated, and the record at that exact key says so:
$ aws s3 ls s3://spawn-results-942542972736-us-west-2/tasks/cookbook-polish-align-r2/
1 .exitcode
11069 command.log
337 completion.json
$ aws s3 cp s3://.../tasks/cookbook-polish-align-r2/completion.json -
{
"task_id": "cookbook-polish-align-r2",
"run_id": "643c4c73-0b67-46fe-92f8-aae906a0c366",
"exit_code": 0,
"state": "completed",
"started_at": "2026-10-05T15:17:14Z",
"ended_at": "2026-10-05T15:18:04Z",
"logs": ["s3://.../tasks/cookbook-polish-align-r2/command.log"],
"retry_class": ""
}And yet:
$ spawn task status cookbook-polish-align-r2
Task cookbook-polish-align-r2: running (no completion record yet)state: "completed", exit_code: 0, matching run_id — reported as running.
It is not specific to this task, which I think narrows it
Two unrelated tasks from earlier sessions behave identically — their records are present and equally unreadable now:
$ spawn task status xarch-gatk4-arm64-t1
Task xarch-gatk4-arm64-t1: running (no completion record yet)
$ aws s3 ls s3://.../tasks/xarch-gatk4-arm64-t1/completion.json
277 completion.json
$ spawn task status xarch-of-scaled-arm64-r1
Task xarch-of-scaled-arm64-r1: running (no completion record yet)
$ aws s3 ls s3://.../tasks/xarch-of-scaled-arm64-r1/completion.json
285 completion.jsonSo it is the read path, not the write path, and it affects every task I can test. The write path is demonstrably correct — spawn prints the key and the object is there.
I believe this is a regression rather than long-standing: --wait worked in earlier sessions on this same account and bucket (I have notes on its behaviour, including a stale-record-on-same-task_id-reuse quirk, which required it to be reading records at all). The older records above were written by older spawn versions and are unreadable by 0.121.0.
Why it matters more than the exit code
Two of this project's hard rules interact badly with it:
--waitis how a recipe is driven.make runwrapstask run --wait, so every successful task now appears to fail and blocks for the full TTL. On a 25-minute TTL that is 25 minutes of wall time per task to learn nothing.- It inverts the "never trust an exit code" discipline. This project's rule is that exit 0 is not evidence of success — so a smoke check runs inside the task and the bucket is checked afterwards. That discipline is what let me notice this at all: the exit code said failure, the outputs said success, and the outputs were right. But an operator who trusts
--waitwould now conclude a working recipe is broken, and anyone retrying would pay twice.
What I did instead, in case it is useful as a workaround
Dropped --wait entirely and polled the output bucket for the declared outputs. That costs nothing extra — the instance self-terminates on completion either way — and it is strictly more trustworthy than a completion record because it checks the artifacts rather than a status field.
Reproduce
spawn task run --spec any.task.json --wait # succeeds in seconds, --wait times out at TTL, exit 1
aws s3 ls s3://spawn-results-<acct>-<region>/tasks/<task_id>/ # completion.json is present
spawn task status <task_id> # "running (no completion record yet)"Happy to run anything diagnostic against this account — I have several tasks in this state and they are cheap to re-create.
Activity
fix(task): stop appending the task id to the results key twice (#715) (…
chore(release): v0.122.0