{"record":{"id":"26a9f5fb7d0d3bc8","repo":"jdx/mise","slug":"unsupported-lockfile-format-value","errorCode":null,"errorMessage":"unsupported lockfile format {value}","messagePattern":"unsupported lockfile format (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":4017,"sourceCode":"                // Silently discard env field from old lockfiles for backwards compat\n                t.remove(\"env\");\n                LockfileTool {\n                    version: t\n                        .remove(\"version\")\n                        .map(|v| v.try_into())\n                        .transpose()?\n                        .unwrap_or_default(),\n                    backend: t\n                        .remove(\"backend\")\n                        .map(|v| v.try_into())\n                        .transpose()?\n                        .unwrap_or_default(),\n                    specifiers,\n                    options,\n                    platforms,\n                }\n            }\n            _ => bail!(\"unsupported lockfile format {}\", value),\n        };\n        Ok(tool)\n    }\n}\n\nimpl LockfileTool {\n    fn into_toml_value(self, include_specifiers: bool) -> toml::Value {\n        let mut table = toml::Table::new();\n        table.insert(\"version\".to_string(), self.version.into());\n        if let Some(backend) = self.backend {\n            table.insert(\"backend\".to_string(), backend.into());\n        }\n        if include_specifiers && !self.specifiers.is_empty() {\n            table.insert(\n                \"specifiers\".to_string(),\n                self.specifiers.into_iter().collect::<Vec<_>>().into(),\n            );\n        }","sourceCodeStart":3999,"sourceCodeEnd":4035,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/lockfile.rs#L3999-L4035","documentation":"LockfileTool::try_from(toml::Value) accepts only the known lockfile tool entry shapes (a table with version/specifiers/options/platforms fields, or the recognized legacy shape); any other TOML value type bails with 'unsupported lockfile format <value>'. It is the per-tool structural guard during parsing.","triggerScenarios":"Parsing a [[tools.<short>]] entry whose value is not one of the supported shapes — e.g. a bare string version, an integer, or a table missing the required structure. Comes from hand-edited lockfiles, foreign writers, or corrupted merges.","commonSituations":"Hand-writing mise.lock tool entries as strings; a script generating lockfile entries incorrectly; merge conflicts leaving mixed/malformed tool blocks.","solutions":["Rewrite each tool entry as a proper table with version (and optional specifiers/options/platforms) fields","Delete mise.lock and regenerate it with `mise lock` / `mise install` using the current mise version","Diff mise.lock against a known-good version (git checkout -- mise.lock then re-lock) to restore the expected format"],"exampleFix":"# before (mise.lock)\n[[tools.node]]\n\"20.0.0\"\n# after\n[[tools.node]]\nversion = \"20.0.0\"","handlingStrategy":"validation","validationCode":"// Validate each tool entry is a supported table shape before parsing\nfor e in tools_array {\n    assert!(e.is_table() && e.get(\"version\").map(|v| v.is_str()).unwrap_or(false),\n            \"tool entry must be a table with string version\");\n}","typeGuard":"fn is_lockfile_tool(v: &toml::Value) -> bool {\n    v.as_table().map(|t| t.get(\"version\").map(|x| x.is_str()).unwrap_or(false)).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Write tool entries as tables with a string version field","Regenerate mise.lock instead of hand-writing entries","Lint lockfile structure in CI to catch malformed commits early"],"tags":["lockfile","toml","parsing"],"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-14T05:17:10.506Z"}