{"record":{"id":"ef18e9728524f758","repo":"jdx/mise","slug":"dotfile-target-encrypt-must-be-a-boolean","errorCode":null,"errorMessage":"dotfile {target}: encrypt must be a boolean","messagePattern":"dotfile (.+?): encrypt must be a boolean","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":535,"sourceCode":"        && (first.mode != FileMode::Template\n            || first.base == second.base\n                && config.bootstrap_tera_ctx(&first.origin.config)\n                    == config.bootstrap_tera_ctx(&second.origin.config))\n}\n\n/// Incoming configuration must fail preflight rather than silently dropping\n/// malformed declarations and applying the rest of the setup.\npub(crate) fn validate_incoming_files(config_files: &ConfigMap) -> Result<()> {\n    for (path, config) in config_files {\n        let Some(dotfiles) = config.dotfiles_config() else {\n            continue;\n        };\n        for (target, value) in dotfiles.0 {\n            if value.as_table().is_some_and(|t| {\n                t.contains_key(\"encrypt\")\n                    && t.get(\"encrypt\").and_then(toml::Value::as_bool).is_none()\n            }) {\n                bail!(\"dotfile {target}: encrypt must be a boolean\");\n            }\n            if value.as_table().is_some_and(|t| {\n                t.get(\"encrypt\").and_then(toml::Value::as_bool) == Some(true)\n                    && [\"content\", \"block\", \"line\", \"template\"]\n                        .iter()\n                        .any(|key| t.contains_key(*key))\n            }) {\n                bail!(\n                    \"encrypted dotfile {target} requires an external source, not inline content or edits\"\n                );\n            }\n            let Some(entry) = file_entry_from_toml(&target, value.clone()) else {\n                // Managed line/block edits are handled by the edit engine,\n                // not by this whole-file declaration parser.\n                if value.as_table().is_some_and(|table| {\n                    [\"block\", \"line\", \"template\", \"comment\", \"position\"]\n                        .iter()\n                        .any(|key| table.contains_key(*key))","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/files.rs#L517-L553","documentation":"validate_incoming_files checks each [dotfiles] entry's TOML shape before building FileRequests. The `encrypt` key, when present, must be a boolean; if it is a string, integer, or any other TOML type, mise rejects the entry with this error.","triggerScenarios":"Declaring a [dotfiles.\"<target>\"] table that contains an `encrypt` key whose value is not a TOML boolean (e.g. encrypt = \"true\", encrypt = 1); validate_incoming_files detects contains_key(\"encrypt\") with as_bool() == None and bails.","commonSituations":"Quoting the boolean by accident (`encrypt = \"true\"` instead of `encrypt = true`), or environment-variable/templated config substitution producing a string value for encrypt.","solutions":["Change the value to a bare TOML boolean: encrypt = true (or false).","Remove surrounding quotes from the value in mise.toml.","If the value comes from a template/variable, ensure it interpolates to true/false, not \"true\"."],"exampleFix":"# before\n[dotfiles.\"~/.aws/credentials\"]\nencrypt = \"true\"\n\n# after\n[dotfiles.\"~/.aws/credentials\"]\nencrypt = true","handlingStrategy":"validation","validationCode":"# catch non-boolean encrypt in TOML before running mise\ngrep -nE 'encrypt\\s*=\\s*[\"0-9]' mise.toml && echo \"encrypt must be true/false\"","typeGuard":"const encryptIsBool = (t: Record<string, unknown>) => t.encrypt === undefined || typeof t.encrypt === \"boolean\";","tryCatchPattern":null,"preventionTips":["Write encrypt = true without quotes","Validate mise.toml (mise run schema/check) before applying","Watch for templated values that interpolate as strings"],"tags":["rust","dotfiles","config","type-mismatch"],"backgroundTag":"config-type-mismatch","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"}