{"record":{"id":"eee59500e24a0cd0","repo":"jdx/mise","slug":"unsupported-package-plugin-ownership-state-version","errorCode":null,"errorMessage":"unsupported package plugin ownership state version {} in {}","messagePattern":"unsupported package plugin ownership state version (.+?) in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/plugin.rs","lineNumber":146,"sourceCode":"    }\n\n    fn load_state_at(path: &std::path::Path, manager: &str) -> Result<PackagePluginState> {\n        if !path.exists() {\n            return Ok(PackagePluginState {\n                schema_version: STATE_SCHEMA_VERSION,\n                manager: manager.to_string(),\n                packages: BTreeMap::new(),\n            });\n        }\n        let state: PackagePluginState = serde_json::from_str(&crate::file::read_to_string(path)?)\n            .wrap_err_with(|| {\n            format!(\n                \"failed to read package plugin ownership state {}\",\n                crate::file::display_path(path)\n            )\n        })?;\n        if state.schema_version != STATE_SCHEMA_VERSION {\n            bail!(\n                \"unsupported package plugin ownership state version {} in {}\",\n                state.schema_version,\n                crate::file::display_path(path)\n            );\n        }\n        if state.manager != manager {\n            bail!(\n                \"package plugin ownership state {} belongs to manager '{}', not '{manager}'\",\n                crate::file::display_path(path),\n                state.manager\n            );\n        }\n        Ok(state)\n    }\n\n    fn load_state(&self) -> Result<PackagePluginState> {\n        Self::load_state_at(&self.state_path(), &self.name)\n    }","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/plugin.rs#L128-L164","documentation":"Package plugin ownership state is persisted to a file with a schema version. load_state_at rejects any state file whose schema_version differs from the supported STATE_SCHEMA_VERSION, preventing mise from interpreting an on-disk format it doesn't understand.","triggerScenarios":"A plugin ownership state file on disk was written by a newer or older mise/plugin version whose STATE_SCHEMA_VERSION differs; the file was hand-edited or copied from another machine with a different version.","commonSituations":"Upgrading or downgrading mise across a schema change while old state files remain in MISE_DATA_DIR; syncing dotfiles/data dirs between machines with different mise versions; stale state after a plugin update.","solutions":["Remove the stale ownership state file shown in the error so it is regenerated on the next plugin package operation","Re-run the plugin's package install/prune action with the current mise version to write fresh state","Align mise versions across machines instead of copying state files between them","If this happens after a downgrade, upgrade mise back to the version that wrote the state"],"exampleFix":"// before\nmise plugins packages install myplugin foo\n# error: unsupported package plugin ownership state version 1 in ~/.local/share/mise/plugins/myplugin/state.json\n// after\nrm ~/.local/share/mise/plugins/myplugin/state.json\nmise plugins packages install myplugin foo   # regenerates state with current schema","handlingStrategy":"fallback","validationCode":"let state_path = plugin.state_file();\nif state_path.exists() {\n    let v: serde_json::Value = serde_json::from_str(&fs::read_to_string(&state_path)?)?;\n    if v[\"schema_version\"] != STATE_SCHEMA_VERSION { fs::remove_file(&state_path)?; }\n}","typeGuard":"fn state_is_current(s: &OwnershipState) -> bool { s.schema_version == STATE_SCHEMA_VERSION }","tryCatchPattern":"match plugin.load_state().await {\n    Err(e) if e.to_string().contains(\"unsupported package plugin ownership state version\") => {\n        delete_state_file(); plugin.load_state().await\n    }\n    other => other,\n}","preventionTips":["Don't hand-edit or share plugin state files between machines with different mise versions","Upgrade mise (not downgrade) when a schema-version error appears","Back up and regenerate state after major mise upgrades"],"tags":["schema-version","state-file","plugin","migration"],"backgroundTag":"schema-validation-failed","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"}