Skip to content

[BUG] Rollback of controller fails when older binary lacks DOWN files for newer schema versions #1881

@onematchfox

Description

@onematchfox

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

Controller Service

🚦 Impact/Severity

Blocker

🐛 Bug Description

When the kagent controller is downgraded to a previous version, the older controller fails to start if the newer version applied schema migrations that are unknown to the older version. This was observed when attempting to rollback after a failed upgrade from 0.9.0 to 0.9.3´. The .down.sql files for those migrations are embedded only in the newer container. The older container can neither roll the schema back nor start against the newer schema, resulting in a crash loop.

🔄 Steps To Reproduce

  1. Deploy application v0.9.0 — embeds migrations 000001–000003. Schema reaches version 3.
  2. Upgrade to v0.9.3 — embeds migrations 000001–000004. Schema reaches version 4.
  3. v0.9.3 is found to be broken; downgrade back to v0.9.0.
  4. v0.9.0 starts against a DB at schema version 4. Its embedded source only knows versions 1–3.

🤔 Expected Behavior

Rolling back to a previous version is a standard recovery operation (e.g. when a new release introduces a regression) and should work reliably.

📱 Actual Behavior

No response

💻 Environment

No response

🔧 CLI Bug Report

No response

🔍 Additional Context

No response

📋 Logs

📷 Screenshots

No response

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions