Skip to content

rollback: hook or build failure leaves the new revision stuck in pending-rollback #32867

Description

@ChadiDridi

If helm rollback fails after the new revision is stored, that revision is never marked failed. It stays pending-rollback, and every later upgrade fails with another operation (install/upgrade/rollback) is in progress.

Repro: rev 1 has a failing pre-rollback hook, rev 2 is deployed.

$ helm rollback app 1        # hook fails
$ helm history app           # rev 3: pending-rollback "Rollback to 1"
$ helm upgrade app ./chart
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

The same happens when a post-rollback hook fails, when the current manifest can't be built (e.g. it uses an API the cluster no longer serves), and in the rollback run by upgrade --rollback-on-failure.

Cause: performRollback returns early on the Build error and on pre/post-rollback hook errors (pkg/action/rollback.go:223, :234, :301) without updating the stored revision. Only the Update and wait failure paths mark it failed. Install and upgrade mark the release failed for the same kinds of errors.

Related: #11863 (generic recovery for stuck releases).

Helm version: main (c540ca0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions