{"record":{"id":"19c97b904e97857b","repo":"jdx/mise","slug":"inline-content","errorCode":null,"errorMessage":"inline content","messagePattern":"inline content","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":2269,"sourceCode":"    let mut unavailable_bodies = HashSet::new();\n    for file in files {\n        if !is_mise_config_target(&file.target)\n            || (file.mode != system::files::FileMode::Content && !file.source.is_file())\n        {\n            continue;\n        }\n        if file.mode == FileMode::Template {\n            config_files.shift_remove(&file.target);\n            unavailable_bodies.insert(file.target.clone());\n            debug!(\n                \"bootstrap: template config target {} skipped in dry-run config simulation \\\n                 because template rendering may execute commands\",\n                file.target.display()\n            );\n            continue;\n        }\n        let contents = if file.mode == system::files::FileMode::Content {\n            Ok(file.content.clone().expect(\"inline content\"))\n        } else {\n            crate::file::read_to_string(&file.source)\n        };\n        match contents {\n            Ok(body) => match parse_mise_config_body(&file.target, &body) {\n                Ok(cf) => {\n                    bodies.insert(file.target.clone(), body);\n                    config_files.insert(file.target.clone(), cf);\n                }\n                Err(err) => {\n                    warn!(\n                        \"[dotfiles].\\\"{}\\\": failed to parse config source {}: {err}\",\n                        file.target_raw,\n                        file.source.display()\n                    );\n                }\n            },\n            Err(err) => {","sourceCodeStart":2251,"sourceCodeEnd":2287,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L2251-L2287","documentation":"A `.expect()` panic in mise's bootstrap managed-file writer (src/cli/bootstrap.rs:2269). Files with `FileMode::Content` must carry their payload inline in `file.content`; the panic fires when a content-mode file has no inline content, so the writer has nothing to write.","triggerScenarios":"A managed file entry declares `mode = \"content\"` (or the code sets FileMode::Content) but `content` was never populated — e.g. a config entry missing the `content` field or a template-render step that failed to fill it.","commonSituations":"Mistaken [bootstrap.files] entry with mode content but no content key; upstream refactors replacing file reads with inline content without updating all constructors.","solutions":["Set the `content` field for every file entry that uses mode \"content\"","Switch the entry to mode \"file\"/\"template\" with a valid `source` path instead","Validate file entries at parse time: content mode requires non-empty content"],"exampleFix":"// before\nOk(file.content.clone().expect(\"inline content\"))\n// after\nfile.content.clone().ok_or_else(|| anyhow!(\"file {} uses content mode but has no inline content\", file.target.display()))","handlingStrategy":"validation","validationCode":"if file.mode == FileMode::Content && file.content.is_none() { return Err(anyhow!(\"file {} uses content mode without content\", file.target.display())); }","typeGuard":"let inline = file.content.as_deref().filter(|_| file.mode == FileMode::Content);","tryCatchPattern":"match file.content.clone() { Some(c) => write(c), None => bail!(\"missing inline content for {}\", file.target.display()), }","preventionTips":["Validate [bootstrap.files] entries at config parse time","Prefer mode \"file\" with a source path when content is not inline","Snapshot-test managed file parsing for content/file mode pairs"],"tags":["rust","panic","config","bootstrap"],"backgroundTag":"missing-required-config-field","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}