Repository navigation
fix(serverless): say why a deploy --wait rollout failed when a worker could not start - #232
Conversation
… could not start A rollout can fail after a ready build, for example when a worker cannot prepare a Shared Volume. The builds then hold no error, and by the time the app reads failed the API has stopped the worker and replaced its reason, so --wait printed only a hint to inspect the builds, or a bare timeout. --wait now reads the app's live workers on each poll, prints a line when a worker turns unhealthy or waits for disk, and names the last such worker and its reason when the app fails or the wait times out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… recovered Of several workers in trouble the deploy wait now names the newest, which during an update is one of the version rolling out, and it forgets the trouble once live workers are listed and none is in trouble, so a worker that recovered is not blamed for a later failure. An empty list keeps it: that is the worker the API stopped. The list reads pages of 100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include
|
There was a problem hiding this comment.
🟡 Changes recommended
Deployment failure reporting can surface obsolete build errors, discard captured worker failure causes during teardown, and miss troubled workers beyond the first page.
3 open issues
What changed in this PR
Improves serverless deploy --wait diagnostics by capturing worker startup problems while a rollout is in progress, before teardown replaces their failure reasons.
Changes:
- Polls live workers and prints newly observed unhealthy or disk-short conditions.
- Includes captured worker details in rollout failure and timeout errors.
- Adds watcher and deployment tests while preserving resume and version-activation messages.
| File | Description |
|---|---|
internal/cmd/serverless/deploy.go |
Integrates worker observation and failure diagnostics into deployment waits. |
internal/cmd/serverless/deploy_workers.go |
Adds worker trouble tracking and diagnostic formatting. |
internal/cmd/serverless/deploy_workers_test.go |
Tests worker selection, recovery, failures, and timeouts. |
internal/cmd/serverless/deploy_test.go |
Updates tests for the worker-cause argument. |
internal/cmd/serverless/apps_versions.go |
Passes no worker cause to preserve activation messages. |
internal/cmd/serverless/apps_lifecycle.go |
Passes no worker cause to preserve lifecycle messages. |
Review effort: Balanced
emmmile
left a comment
There was a problem hiding this comment.
Reviewed by Emilio's agent (Claude Opus 5.5).
… cause while the worker stops The deploy wait now names an unhealthy worker before one still waiting for disk, which the rollout keeps waiting on, and the newest only among equals. It forgets a cause only when that same worker is seen serving again: a worker the API is stopping after the rollout failed reads stop-requested, and that poll erased the reason the failed-app error should name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emmmile
left a comment
There was a problem hiding this comment.
Reviewed by Emilio's agent (Claude Opus 5.5).
The watch read only the first 100 workers, so a worker in trouble behind a page of healthy ones was never seen. It now follows the cursor with the same filters, up to 10 pages a poll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emmmile
left a comment
There was a problem hiding this comment.
Reviewed by Emilio's agent (Claude Opus 5.5).

What
deploy --waitnow says why a rollout failed when the build was ready but a worker could not start, for example a worker that could not prepare a Shared Volume.--waitlists the app's live workers on each poll (versionId=all,state=live, pages of 100). It prints a line when a worker turnsunhealthyor waits for disk (volume-disk-short):Application my-app: worker 2ab2c491-… is unhealthy: fetch-failedapplication my-app failed: worker 2ab2c491-… is unhealthy: fetch-failed; inspect workers with 'runware serverless apps workers my-app --version all'last seen: worker … is pulling: volume-disk-short.Why
The builds of such a rollout hold no error. By the time the app reads
failed, the API has stopped the worker, and its reason has become the stop (stop-requested). So the reason has to be read during the wait.Not changed
apps resumeandapps versions activatekeep their messages; they pass no worker cause toappFailedErr.activewaits on the version pin instead (waitForSubmittedVersion). A failed rollout there leaves the appactiveon its previous version, and that path still reports no worker reason, as before.Tests
deploy_workers_test.go:fetch-failed: the error and a single stderr line name the worker;pulling/volume-disk-short;volume-preparingworker is not treated as trouble, and the builds hint stays;observepicks the newest worker in trouble, forgets a recovered one, and keeps the cause once the list is empty.make testandmake lintpass locally.