{"record":{"id":"380e560b596b590d","repo":"jdx/mise","slug":"non-finite-numbers-cannot-be-represented-in-mise-lock","errorCode":null,"errorMessage":"non-finite numbers cannot be represented in mise.lock","messagePattern":"non-finite numbers cannot be represented in mise\\.lock","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":173,"sourceCode":"            hasher.update((values.len() as u64).to_be_bytes());\n            for key in values.keys().sorted() {\n                bytes(hasher, b'k', key.as_bytes());\n                hash_canonical_toml(hasher, &values[key]);\n            }\n        }\n    }\n}\n\nfn yaml_to_toml(value: serde_yaml::Value) -> Result<toml::Value> {\n    use serde_yaml::Value;\n    Ok(match value {\n        Value::Bool(value) => toml::Value::Boolean(value),\n        Value::Number(value) => {\n            if let Some(value) = value.as_i64() {\n                toml::Value::Integer(value)\n            } else if let Some(value) = value.as_f64() {\n                if !value.is_finite() {\n                    bail!(\"non-finite numbers cannot be represented in mise.lock\")\n                }\n                toml::Value::Float(value)\n            } else {\n                bail!(\"unsupported number in aube lockfile\")\n            }\n        }\n        Value::String(value) => toml::Value::String(value),\n        Value::Sequence(values) => toml::Value::Array(\n            values\n                .into_iter()\n                .map(yaml_to_toml)\n                .collect::<Result<_>>()?,\n        ),\n        Value::Mapping(values) => {\n            let mut table = toml::Table::new();\n            for (key, value) in values {\n                let Value::String(key) = key else {\n                    bail!(\"aube lockfile mapping keys must be strings\")","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile.rs#L155-L191","documentation":"Thrown while converting the parsed aube lockfile YAML into TOML when a number is NaN or infinite. TOML has no representation for non-finite floats, and mise.lock is stored as TOML, so such values cannot round-trip and are rejected.","triggerScenarios":"A mise.lock (or its YAML source) contains a non-finite numeric value like `.nan`, `.inf`, or `-/.inf` inside the graph.","commonSituations":"Hand-edited lockfile using YAML's `.inf`/`.nan` literals; corrupted or generated-by-another-tool lockfile containing such values.","solutions":["Replace the non-finite value with a finite number in mise.lock","Restore the lockfile from git","Delete and regenerate the lockfile","Find the tool that wrote the bad value and fix its checksum/metadata input"],"exampleFix":"# before\nsize: .inf\n# after\nsize: 10485760","handlingStrategy":"validation","validationCode":"yq -e '[.. | numbers | . as $n | select(($n | .nan) or false)] | length == 0' mise.lock","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never write .inf/.nan into lockfiles","Treat mise.lock as machine-managed; regenerate instead of editing","Validate lockfile content after merges"],"tags":["lockfile","toml","yaml","numbers"],"backgroundTag":"value-out-of-range","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"}