Repository navigation
Description
Bug type
Upgrade lifecycle gap
Summary
Container image upgrades can bypass the migrations that normally run through openclaw upgrade.
When an operator replaces one OpenClaw container image with another while preserving the same state/config volume, the container starts the gateway directly. Startup may run limited config/state preflight work, but it does not detect that the OpenClaw version changed and run the pending versioned upgrade migrations before declaring the gateway ready.
This means any migration added between image versions can be skipped for common Docker/Kubernetes-style upgrades.
Expected behavior
On gateway startup, OpenClaw should detect when the current OpenClaw version differs from the last successfully migrated version for the mounted state/config.
Before gateway readiness, it should either:
- run all pending
openclaw upgrademigrations for that version transition, then record the successful migrated version; or - fail readiness with a clear, actionable error if those migrations cannot safely run.
The startup path should be idempotent, locked against concurrent starts, and should not report a healthy gateway while required upgrade migrations are still pending.
Actual behavior
Replacing the container image starts the gateway without running the full upgrade migration path.
A recent 2026.6.10 -> 2026.6.11 container replacement exposed this through a configured Mattermost channel not being converged after upgrade. That is only the example. The Mattermost-specific activation/repair bug is tracked separately in #98564.
The broader issue here is that container image replacement does not automatically execute the migrations that openclaw upgrade would have run.
Steps to reproduce
- Run an OpenClaw container at version N with state/config mounted.
- Configure state that requires a migration in version N+1.
- Stop/remove only the container, preserving the mounted state/config.
- Start a version N+1 OpenClaw container normally.
- Observe that the gateway starts without eagerly running the full upgrade migration path for N -> N+1.
Impact
This affects users who upgrade by replacing container images, which is the normal upgrade model for Docker and Kubernetes deployments.
Depending on the skipped migration, the result can be missing plugins, stale config, inconsistent state, broken channels, missed messages, or other release-specific failures. The gateway can appear ready even though the mounted state has not been upgraded for the current image.
Non-goal
This issue should not track the Mattermost-specific activation behavior. Keep that in #98564. Mattermost is useful only as a concrete example showing why skipped container-upgrade migrations are dangerous.
Acceptance criteria
- Startup records and compares the last successfully migrated OpenClaw version for the mounted state/config.
- A version change runs the same migration set expected from
openclaw upgradebefore gateway readiness. - Migration execution is idempotent and protected from concurrent startup races.
- Migration failures prevent healthy readiness and produce actionable logs.
- Tests cover a container-style upgrade path where the gateway starts directly after an image version change.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 1, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 4, 2026, 10:56 PM ET / 02:56 UTC.
Summary
Keep open: current main still treats direct container image replacement as a gateway startup path, not as an update/finalize path, so the reported 2026.6.10 to 2026.6.11 migration gap remains a real upgrade/readiness problem despite adjacent Mattermost and config-health fixes.
Reproducibility: yes. the issue discussion includes a live official-image 2026.6.10 to 2026.6.11 container swap where the default gateway command became healthy while version metadata and doctor output still showed pending migration work.
Root-cause cluster
Relationship:
canonicalCanonical: #98565
Summary: This issue is the remaining canonical container-upgrade readiness/migration contract problem; related Mattermost activation and macOS config-health reports cover narrower symptoms or adjacent second-writer cleanup.
Members:
partial_overlap: [Bug]: Mattermost repair installs external plugin without enabling gateway startup #98564 - It reports the Mattermost symptom after 2026.6.10 to 2026.6.11 upgrade and was fixed by PR 98608, but it does not solve generic container image version-transition gating.partial_overlap: fix: Mattermost fails to load after configured plugin repair #98608 - The merged PR materializes explicit Mattermost plugin activation after configured-plugin repair, leaving the broader direct-container-upgrade readiness contract open.adjacent_distinct: [Bug]: Mac app still writes legacy logs/config-health.json every ~3s, permanently conflicting with the config_health_entries SQLite migration #98917 - It diagnoses a macOS config-health legacy writer causing recurring migration warnings, which is adjacent to doctor/migration noise but not the container startup version-transition bug.adjacent_distinct: fix(macos): stop runtime config-health sidecar access #99039 - The merged PR fixes the macOS config-health sidecar writer, not the direct container image upgrade path.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
The bug is live-reproduced, but protected maintainer labels and the startup-versus-doctor/update policy choice make this a maintainer design decision rather than a safe automatic fix PR.
Review details
Best possible solution:
Define a maintainer-owned container upgrade contract that records the last successfully migrated OpenClaw version and either runs only safe idempotent pending migrations under a startup lock before readiness or fails readiness with an actionable in-product repair path.
Do we have a high-confidence way to reproduce the issue?
Yes: the issue discussion includes a live official-image 2026.6.10 to 2026.6.11 container swap where the default gateway command became healthy while version metadata and doctor output still showed pending migration work.
Is this the best way to solve the issue?
Unclear until maintainers decide the startup policy: source evidence supports the bug, but the best fix must choose which migrations are safe before readiness versus which should hard-fail with a repair path.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against b34c188f8f0d.
Label changes
Label changes:
impact:ux-friction: Operators currently have to inspect logs, config metadata, or doctor output to discover that readiness did not mean upgrade repair completed.issue-rating: 🦀 challenger crab: Current issue advisory state selects this label.clawsweeper:current-main-repro: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.issue-rating: 🐚 platinum hermit: Current issue advisory state no longer selects this label.Label justifications:
P1: The issue affects real container upgrades where the gateway can report healthy while channel/plugin migrations remain pending and messages may be missed.impact:message-loss: The reported failure mode can leave upgraded channel plugins unloaded while the gateway is ready, so inbound channel messages are not consumed.impact:ux-friction: Operators currently have to inspect logs, config metadata, or doctor output to discover that readiness did not mean upgrade repair completed.impact:other: The core upgrade/readiness contract is affected beyond a single channel, including version-transition detection and startup migration ownership.maturity:stable: The affected gateway lifecycle and CLI install/update/doctor surfaces are M4 stable in the repository maturity scorecard.Evidence reviewed
What I checked:
/healthzbecame ready whilemeta.lastTouchedVersionstayed at 2026.6.10 and doctor still reported pending legacy-state work./healthzand the default command launchesnode openclaw.mjs gateway, so a direct image replacement enters the gateway path rather than an update/finalize command. (Dockerfile:347, b34c188f8f0d)src/cli/run-main.ts:190, b34c188f8f0d)ensureConfigReadyruns doctor config preflight withmigrateState: trueandmigrateLegacyConfig: false, matching the observed startup state-migration subset rather than full doctor repair. (src/cli/program/config-guard.ts:190, b34c188f8f0d)--fix/--yesis selected, which is separate from gateway readiness on direct image startup. (src/commands/doctor-config-flow.ts:138, b34c188f8f0d)meta.lastTouchedVersionis stamped from the current package version when config is written, so gateway startup alone does not record that an image-version transition completed. (src/config/io.meta.ts:16, b34c188f8f0d)Likely related people:
src/cli/gateway-cli/pre-bootstrap.ts,src/cli/run-main.ts)src/infra/update-post-core-finalize.ts,src/infra/package-update-steps.ts)src/commands/doctor/repair-sequencing.ts,src/config/plugin-auto-enable.shared.ts)src/gateway/server-startup-log.ts,src/gateway/server-startup-post-attach.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.[-][Bug]: Container image upgrades skip configured-plugin convergence before gateway ready[/-][+][Bug]: Container image upgrades skip openclaw upgrade migrations before gateway startup[/+]jacobtomlinson commentedon Jul 1, 2026
@clawsweeper review
clawsweeper commentedon Jul 1, 2026
🦞🧹
ClawSweeper re-review requested.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow
sweep.yml, eventrepository_dispatch).Result: the existing ClawSweeper review comment will be edited in place when the review finishes.
AmirF194 commentedon Jul 3, 2026
Live repro for the
needs-live-reprogate, using the exact image-swap flow from the issue's steps (macOS host, Docker Desktop; official GHCR images).Setup
ghcr.io/openclaw/openclaw:2026.6.10(sha256:af7ea052cf21…) and:2026.6.11(sha256:3814fb1f62f9…), one shared state volume mounted at/home/node/.openclaw,OPENCLAW_GATEWAY_TOKENvia env, default image CMD (node openclaw.mjs gateway,Dockerfile:350).config set gateway.mode localvia the 6.10 CLI →meta.lastTouchedVersion: "2026.6.10"; ran the 6.10 gateway once to healthy, stopped it, replaced only the image with 6.11 (volume preserved), started normally.Observed on the 6.11 boot (same volume)
ready+healthzOK (~4s), the state still saidmeta.lastTouchedVersion: "2026.6.10". Only runningopenclaw doctor --fixinside the container advanced it to"2026.6.11"— so the recorded-version mechanism exists, but only on the CLI repair path that container upgrades never execute.update-check.json → shared SQLite(that pass is not version-gated), but seconds afterhealthzwent green, read-onlyopenclaw doctor --linton the same state returned"ok": falsewith a pendingcore/doctor/legacy-statefinding:Config health state: legacy JSON file → shared SQLite state — Run 'openclaw doctor --fix' to migrate legacy state.[state-migrations] Legacy state migration warnings: Left legacy config health state in place because 1 entry conflicts with shared SQLite state: /home/node/.openclaw/logs/config-health.json— and the same warning re-appears on every subsequent healthy restart of the 6.11 container.Startup log excerpt from the first 6.11 boot:
Secondary observation (cross-ref, not this issue's scope): the
config-health.jsonlegacy conflict above was produced organically by the 6.10 gateway's own writes, and it survives evenopenclaw doctor --fix --non-interactiveunder 6.11 (same "left in place" warning). That convergence gap looks like the #98917 cluster; mentioning it here only because it means the pending-migration state in observation 2/3 is not even operator-recoverable non-interactively.(Excluded from the findings:
core/doctor/skills-readinesswarnings fromdoctor --lint, which are just missing optional binaries in the slim container, and the Mattermost specifics per the issue's non-goal.)This matches the acceptance criteria's premise: nothing on the container startup path compares
lastTouchedVersionagainst the running image version or runs the doctor/upgrade migration set before readiness. Evidence only — the fix shape stays with maintainers per theneeds-product-decisionlabel. Happy to re-run variations (different version pairs, k8s-style restart loops,--fixposture comparisons) if useful.AI-assisted (Claude Code): all commands executed live as described; logs and state diffs captured from the actual containers.