Repository navigation
fix(macos): stop running dashboard-api writers before private-store migration on launch - #8076
Conversation
|
Review of exact head The launch call also stops writers before I am preparing a narrow repair and regression coverage. This is source-level reproduction with fake Docker, not live Mac acceptance; the Mac target is currently behind a Tailscale reauthentication gate. |
|
Thanks for addressing migration failures when an older macOS dashboard API is still running. Advisory status: not ready yet Quickest path to merge:
What I checked:
Moving the stop behind the migration decision should keep the intended fix without interrupting an already-ready API. |
…igration on launch When rerunning the macOS installer or performing an update/restart on an existing deployment upgrading from v3.0.0 (or pre-Oct-15 commits), dashboard-private-state.py attempts to migrate legacy SQLite stores to Docker volumes. Because dashboard-api is still running from the pre-existing deployment, Stores.prepare() aborts with 'Private dashboard migration/restore needs stopped writers', breaking automated install, update, and restart flows. Restrict writer stopping to launch operations that actually require migration: - Inspect and validate ownership of all consumers in Stores.consumers() before issuing any container stops, ensuring foreign consumers abort immediately without halting owned containers. - Pass stop=True from launch into Stores.prepare() so stops only execute once unfinished restore and consumer custody checks pass and an incomplete store is identified. Fully migrated stores and active restore guards preserve running API containers without unnecessary downtime or premature stops. - Verify stopped container state before copying SQLite stores to Docker volumes. Manual restore and standalone prepare continue to refuse running writers. Fixes Osmantic#8020
79fca47 to
94c44da
Compare
|
Thanks @Lightheartdevs for the sharp review and reproduction details! Updated head
|
…8076-author-94c44da4
…8076-author-94c44da4
|
Reviewed the author revision |
Summary
When rerunning
install-macos.shor executingods restart/ods updateon a running macOS installation upgrading from v3.0.0 (or pre-994cf6475commits),installers/macos/lib/dashboard-private-state.pyattempts to migrate legacy SQLite stores (data/pixel-imagesanddata/pixel-chat-results) onto Docker volumes. Becausedashboard-apiis still actively running from the pre-existing deployment,Stores.prepare()invokesself.consumers(stopped=True)and raisesPrivate dashboard migration/restore needs stopped writers. Run ods stop, then ods start for migration; retry restore after stopping.. This causes automated installer reruns, updates, and restarts to fail during the final compose launch step after configuration and source files have already been updated.This patch restricts writer stopping strictly to the migration path after store validation:
Stores.consumers()now validates ownership of all consumers across the inventory before issuing any container stops, ensuring foreign consumers abort immediately withprivate-store-foreign-consumerwithout halting owned containers.Stores.prepare(directory, stop=args.action == "launch")validates that no unfinished restore exists (image-restore-active.json), checks consumer custody, and runs completed-store checks before executing writer stops.prepareandrestorecalls continue to reject active writers.Fixes #8020.
AI Assistance
Antigravity provided investigation, with autonomous corrections, independent tests, and macOS lifecycle simulation verification.
Release Lane
release/2.6.xmainStable hotfix reason:
Changed Surface
Risk And Validation
git diff --checkrelease/2.6.xCommands/results:
Operational Change Check
If this PR touches installer phases, bootstrap logic, compose stack generation,
service manifests, dashboard API control flows, Hermes, model routing, GPU or
runtime detection, lifecycle commands, host mutation, or network exposure, it
requires release-grade fleet validation before release unless the PR explains a
narrower equivalent.
Notes For Reviewers
This update addresses advisory review feedback for exact head
79fca4789:Stores.prepare().docker stopis issued.launchon completed stores and active restore guards preserve running API containers.Independent installed validation
Head
7d89de9bpreserves the author fix and includes main7e9d2ed6. The 39 Python tests and six shell scenarios pass. An official Mac Mini install completed with exit 0; 4,608 source files and 15 disabled recipes matched, with no missing files, and the generated Hermes configuration matched its expected installer transformation.A disposable real-Docker project using the installed API image and synthetic SQLite data passed six paths: current-main launch refusal with a running consumer; standalone prepare refusal; candidate migration and launch; idempotent completed-store start; unfinished-restore refusal; and foreign-consumer refusal. Values survived migration, completed stores and refusal paths retained their metadata, and production containers/configuration stayed unchanged. Only the test containers and volumes were removed. The test API sleeps: this proves running-consumer handling, not concurrent SQLite writing.
After reinstall, the existing Portal conversation executed Python through local Qwen 3.5 9B and returned actual output
684with exit 0 in 105 seconds. This is scoped acceptance; fleet green remains pending.