Skip to content

[Bug]: Container image upgrades skip openclaw upgrade migrations before gateway startup #98565

Description

@jacobtomlinson

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 upgrade migrations 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

  1. Run an OpenClaw container at version N with state/config mounted.
  2. Configure state that requires a migration in version N+1.
  3. Stop/remove only the container, preserving the mounted state/config.
  4. Start a version N+1 OpenClaw container normally.
  5. 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 upgrade before 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

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingclawsweeper:current-main-reproClawSweeper found a high-confidence current-main issue reproduction.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦀 challenger crabExceptional issue quality: high-confidence current-main reproduction and actionable evidence.maintainerMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.regressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions