Repository navigation
Retry and the next start try an unfinished backend update again when it left OpenBot running but not working - #1503
guidovizoso wants to merge 5 commits into
Conversation
…it left OpenBot running but not working, instead of giving up at once
…d runs the version it had A degraded backend whose disk OpenBot found short (or still recovering) now shows the free-space message at once instead of re-running an update that downloads images and fails there again after up to ten minutes. The Retry after space is freed runs the update. When a failed update leaves the backend degraded with its checks failing, the update row no longer says OpenBot runs the version it had (its services are paused) and says Retry tries the update again.
…do/retry-update-on-degraded-stack
|
Review. The core fix is right: a degraded stack with an update on record can only be brought back by Findings, both fixed on this branch in e211ce7 (plus a merge of main):
Checked and fine: a healthy stack (ready, no
|
…efore it settles not working Found on Windows, rc.11 to rc.12: an interrupted update left the services at 0 replicas with the update still prepared and no failed step. After the retried update failed, the first status said starting and the next degraded. The failed update was forgotten on the starting answer, so the row kept "so it runs the version it had" over a back end that did not run. The failed update is now kept while the back end says starting with the update on record, and the row is decided once it settles. A back end that starts with no update on record is unaffected.
|
Follow-up from a live run on Windows (rc.11 to rc.12): Retry brought the stack back, but on the broken screen the update row still said "so it runs the version it had". The first status after the failed update answered |
What was wrong
A dogfooding report: OpenBot Desktop 1.0.1 updated to 1.0.2 on a Mac. On first start, the backend update (Intelligence 0.16.0-rc.10 to rc.11) paused the services (
update-quiesce) and then failed once atdependencies-install. That left the stack running with its checks failing (readinessdegraded) and the update on record (unfinishedUpdate).The window then said OpenBot is stopped, with "OpenBot tries again the next time it starts" on the update row, but every Retry asked for
local statusonce and gave up in 0.0s. The update was never tried again, so the person was stuck.The wait loop in
desktop/src/LocalIntelligence.tsxre-ran an unfinished update only on a stack that was ready, stopped, or still on the release it had with every check passing (kept). A degraded stack with failing checks matched none of these.startis skipped while an update is on record (the CLI refuses it), anddegradedis notstarting, so the wait stopped at once.The fix
stoppedordegradedwith an update on record now runslocal updateagain. That is the only call that gets it going, since the CLI refusesstart. The oldkeptcase is one of these degraded stacks, so the condition now covers it without listing it separately.updatedIntelligence). If the update fails again, the wait stops at once on the failed row ("It stopped while updating where OpenBot keeps your data"). It does not wait the way it does after waking a stopped stack, because nothing on a degraded stack comes back by itself. Each Retry is one more attempt.woken) now explain this.The repair before an update (
local_update.rs)The repair rolls back only a release that Helm left
pending-*, and puts back Learning Deployments that are missing. A release that a faileddependencies-installleftfailedis not touched. Helm 3 upgrades a failed release from its last deployed revision, so it needs no repair. A new fake-CLI case pins this down: the repair does not roll back or re-apply anything, and the next update runs to the end.Tests
LocalIntelligence.test.tsx, "a backend an update left not working runs the update again, and opens once it finishes": status degraded withdependencies-installon record andupdateToset, thenlocal updatecompletes, status is ready and OpenBot starts. Before the fix it failed (no update, nothing started). After the fix it passes.LocalIntelligence.test.tsx, "an update that stops again is tried once per Start, and Retry tries it once more": the first update fails, the wait stops afterstatus, update, statuswith the failed row and Retry, and there is no second update. Retry runsstatus, update, statusagain, that update completes, and OpenBot starts. Before the fix it failed (no update, so no update row). After the fix it passes.App.test.tsx, "a backend whose check fails is still not healthy, with an update on record or not": this test now expects the update to be tried once (status, update, status). Its point is unchanged: a failing check is still not treated as running on the release the stack had, nothing is started and Retry is offered.local_eval.rs,a_release_an_update_left_failed_is_not_repaired_and_the_next_update_finishes: this uses the fake CLI and Helm. The firsthelm upgrade -f stopped.yamlfails and leaves the releasefailed. The repair checks the release and does nothing, the update is not retried in the same call, and the nextlocal updatecompletes with no rollback.Run locally:
bun test desktop/src(407 pass, 0 fail),bun run typecheckin desktop,bun run typecheck:tests, Biome format and lint,cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test --locked --lib --bins(1087 + 304 pass).Not reproduced in the real product
I did not reproduce this in a real Desktop build. The CLI keeps every local stack in one shared config folder, and the machine I worked on also runs an installed OpenBot and other people's stacks. To reproduce, I would have had to make a real rc.10 to rc.11
helm upgradefail on a live stack. Verification is the tests above, including the fake-CLI test of the native update and repair path.