{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/format.rs#L31-L67","documentation":"RepoState::check fails when a setup/history repository was written by a newer (or different) mise whose on-disk format version differs from the FORMAT constant compiled into the running binary. The repo refuses to touch the store rather than misinterpret it, and tells the user to upgrade mise.","triggerScenarios":"Reading or syncing a setup store whose Marked(format) != FORMAT — i.e. the store was created/upgraded by a newer mise release than the one in use.","commonSituations":"Switching machines or shells with an outdated mise binary while the store was migrated by a newer version; pinning mise to an old version while dotfiles sync auto-upgrades the store format; rollback after a format-bumping release.","solutions":["Upgrade mise to the version that supports the store's format (mise self-update or your package manager).","Check the store's format marker and the supported format in mise's release notes before downgrading.","Clone/fresh-init a setup store if you must stay on the old mise version."],"exampleFix":"# before\n$ mise --version\nmise 2026.1.2  # store marked format 3\n# after\n$ mise self-update\n$ mise --version\nmise 2026.9.0","handlingStrategy":"retry","validationCode":"if let RepoState::Marked(format) = repo_state {\n    if format != FORMAT {\n        eprintln!(\"store format {format} > supported {FORMAT}; upgrade mise\");\n    }\n}","typeGuard":null,"tryCatchPattern":"match repo_state.check() {\n    Ok(()) => sync(),\n    Err(e) if e.to_string().contains(\"upgrade mise\") => {\n        upgrade_mise()?;\n        retry_sync()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep mise updated on all machines sharing the setup store.","Pin all machines to mise versions supporting the same store format.","Check release notes for format bumps before downgrading or rolling back."],"tags":["versioning","compatibility","format"],"backgroundTag":"incompatible-source-type","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}