{"record":{"id":"5efdb984111349d8","repo":"kopia/kopia","slug":"no-upgrade-in-progress","errorCode":null,"errorMessage":"no upgrade in progress","messagePattern":"no upgrade in progress","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/format/upgrade_lock.go","lineNumber":107,"sourceCode":"\t\tctx,\n\t\tLegacyIndexPoisonBlobID,\n\t\tgather.FromSlice([]byte(\"The format of this repository has been upgraded and cannot be read by old clients\")),\n\t\tblob.PutOptions{})\n}\n\n// CommitUpgrade removes the upgrade lock from the from the repository format\n// blob. This in-effect commits the new repository format to the repository and\n// resumes all access to the repository.\nfunc (m *Manager) CommitUpgrade(ctx context.Context) error {\n\tif err := m.maybeRefreshNotLocked(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\n\tif m.repoConfig.UpgradeLock == nil {\n\t\treturn errors.New(\"no upgrade in progress\")\n\t}\n\n\t// poison V0 index so that old readers won't be able to open it.\n\tif err := WriteLegacyIndexPoisonBlob(ctx, m.blobs); err != nil {\n\t\tlog(ctx).Errorf(\"unable to write legacy index poison blob: %v\", err)\n\t}\n\n\t// restore the old format version\n\tm.repoConfig.UpgradeLock = nil\n\n\treturn m.updateRepoConfigLocked(ctx)\n}\n\n// RollbackUpgrade removes the upgrade lock while also restoring the\n// format-blob's original version. This method does not restore the original\n// repository data format and neither does it validate against any repository\n// changes. Rolling back the repository format is currently not supported and\n// hence using this API could render the repository corrupted and unreadable by","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/repo/format/upgrade_lock.go#L89-L125","documentation":"CommitUpgrade returns this ad-hoc error when finalizing a repository format upgrade but the repository configuration carries no UpgradeLock, meaning no upgrade was ever initiated. Committing an upgrade requires an in-progress lock; without one the operation is invalid.","triggerScenarios":"Calling FormatManager().CommitUpgrade(ctx) when repoConfig.UpgradeLock is nil — i.e. without a prior successful SetUpgradeLockIntent, or after the lock was already removed.","commonSituations":"Calling CommitUpgrade out of order in scripts or tooling; invoking it on a second connection where the lock set by another process is not visible in the cached config; retrying commit after a previous successful commit already cleared the lock.","solutions":["Call SetUpgradeLockIntent first and only then CommitUpgrade","Verify the lock is present (ReadUpgradeLock) before committing","Ensure all clients share the same blob storage so the lock is visible","Fix orchestration so commit runs exactly once, after the drain phase"],"exampleFix":"// before\nif err := fm.CommitUpgrade(ctx); err != nil { ... }\n// after\nlock, err := fm.ReadUpgradeLock(ctx)\nif err != nil || lock == nil {\n    return errors.New(\"upgrade lock must be set before committing upgrade\")\n}\nif err := fm.CommitUpgrade(ctx); err != nil { ... }","handlingStrategy":"try-catch","validationCode":"lock, err := fm.ReadUpgradeLock(ctx)\nif err != nil { return err }\nif lock == nil {\n    return errors.New(\"cannot commit: no upgrade lock present\")\n}","typeGuard":null,"tryCatchPattern":"if err := fm.CommitUpgrade(ctx); err != nil {\n    if strings.Contains(err.Error(), \"no upgrade in progress\") {\n        log.Info(\"nothing to commit\")\n        return nil\n    }\n    return err\n}","preventionTips":["Always pair CommitUpgrade with a preceding SetUpgradeLockIntent in the same workflow","Make commit/rollback steps idempotent in scripts","Refresh repository config from shared storage before committing","Run only one coordinator process for the upgrade at a time"],"tags":["kopia","upgrade-lock","invalid-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}