{"record":{"id":"3a933fbbe23b55d1","repo":"jdx/mise","slug":"this-setup-repository-uses-format-format-upgrad","errorCode":null,"errorMessage":"this setup repository uses format {format}; upgrade mise (this version supports format {FORMAT})","messagePattern":"this setup repository uses format (.+?); upgrade mise \\(this version supports format (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/format.rs","lineNumber":49,"sourceCode":"/// What the fetched setup branch is.\n#[derive(Clone, Debug, PartialEq, Eq)]\npub(crate) enum RepoState {\n    /// No branch yet: the first publication creates it with the marker.\n    Empty,\n    /// A history-enabled repository of the given format.\n    Marked(u32),\n    /// An existing, non-empty repository without the marker: adopted only\n    /// after a deliberate confirmation.\n    Unmarked,\n}\n\nimpl RepoState {\n    /// Fails for a format this mise does not understand.\n    pub(crate) fn check(&self) -> Result<()> {\n        if let Self::Marked(format) = self\n            && *format != FORMAT\n        {\n            bail!(\n                \"this setup repository uses format {format}; upgrade mise (this version supports format {FORMAT})\"\n            );\n        }\n        Ok(())\n    }\n}\n\npub(crate) fn detect(repo: &HistoryRepo, upstream: Option<&str>) -> Result<RepoState> {\n    let Some(commit) = upstream else {\n        return Ok(RepoState::Empty);\n    };\n    match repo.object_at(commit, MARKER_PATH)? {\n        Some((_, oid)) => Ok(RepoState::Marked(parse_marker(\n            &repo.cat_object_bounded(&oid, 64 * 1024)?,\n        )?)),\n        None => Ok(RepoState::Unmarked),\n    }\n}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/format.rs#L31-L67","documentation":"`RepoState::check` fails when the setup repository's on-disk format marker does not equal the format version this build of mise supports. The repository was written by a newer (or incompatible) mise version; this version refuses to touch it rather than corrupting data.","triggerScenarios":"Opening a setup/history sync repo created or migrated by a mise version whose `FORMAT` differs from the current binary's `FORMAT`.","commonSituations":"Downgrading mise after a format migration; using an old mise on a machine where a newer version already upgraded the setup store; switching between release channels.","solutions":["Upgrade mise to a version that supports the repository's format.","If downgrading intentionally, restore a backup of the setup repository from before the format upgrade.","Create a fresh setup store with the older mise (losing sync state) only if the history is disposable."],"exampleFix":"// before\nmise --version # mise 2025.1.0, repo format 3\n// after\nmise self-update # install a mise that supports the repo's format","handlingStrategy":"fallback","validationCode":"const state = await sync.readRepoState(repoPath);\nif (state.format !== SUPPORTED_FORMAT) {\n  throw new Error(`mise upgrade required: repo format ${state.format}`);\n}","typeGuard":"function isSupportedFormat(state: { kind: string; format?: string }): boolean {\n  return state.kind !== \"marked\" || state.format === SUPPORTED_FORMAT;\n}","tryCatchPattern":"try {\n  await sync.open(repoPath);\n} catch (e) {\n  if (/uses format .* upgrade mise/.test(String(e))) {\n    await upgradeMise(); // then retry\n  } else throw e;\n}","preventionTips":["Keep mise versions consistent across machines sharing a setup store.","Back up the setup repo before running a version that may migrate its format.","Check release notes for format migrations before downgrading."],"tags":["versioning","format","upgrade"],"backgroundTag":"version-incompatible","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}