{"record":{"id":"39b0057074b1445c","repo":"jdx/mise","slug":"setting-is-not-set","errorCode":null,"errorMessage":"Setting [{}] is not set","messagePattern":"Setting \\[(.+?)\\] is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/settings/get.rs","lineNumber":42,"sourceCode":"        let settings = if self.local {\n            let partial = Settings::parse_settings_file(&config::local_toml_config_path())\n                .unwrap_or_default();\n            Settings::partial_as_dict(&partial)?\n        } else {\n            Settings::get().as_dict()?\n        };\n        let mut value = toml::Value::Table(settings);\n        let mut key = Some(self.setting.as_str());\n        while let Some(k) = key {\n            let k = k\n                .split_once('.')\n                .map(|(a, b)| (a, Some(b)))\n                .unwrap_or((k, None));\n            if let Some(v) = value.as_table().and_then(|t| t.get(k.0)) {\n                key = k.1;\n                value = v.clone()\n            } else if is_known_setting(&self.setting) {\n                bail!(\"Setting [{}] is not set\", self.setting);\n            } else {\n                bail!(\"Unknown setting: {}\", self.setting);\n            }\n        }\n        match value {\n            toml::Value::String(s) => miseprintln!(\"{s}\"),\n            value => miseprintln!(\"{value}\"),\n        }\n\n        Ok(())\n    }\n}\n\nfn is_known_setting(key: &str) -> bool {\n    if SETTINGS_META.contains_key(key) {\n        return true;\n    }\n    let prefix = format!(\"{key}.\");","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cli/settings/get.rs#L24-L60","documentation":"`mise settings get KEY` walks dotted key segments through the resolved settings table. If the key is a known setting (is_known_setting() checks it against the generated SETTINGS_META registry) but no value is present at that point in the table, mise reports 'Setting [KEY] is not set' — the setting is valid, just never configured (and no default is materialized into the table at that path).","triggerScenarios":"Running `mise settings get some.setting` for a real setting that has never been set in any config and whose default is not stored in the settings table, e.g. checking an optional setting's state before first use.","commonSituations":"Scripts probing whether a setting was customized before overriding it; users expecting `get` to always print the effective default; querying nested dotted settings where only a parent table exists.","solutions":["Set it if you want a persisted value: `mise settings set KEY VALUE`","See all settings and their current values: `mise settings ls`","If you only needed the effective behavior, rely on the documented default instead of `settings get` output"],"exampleFix":"# before\nmise settings get python.compile   # Setting [python.compile] is not set\n\n# after\nmise settings ls                     # inspect current values + defaults\nmise settings set python true        # set it explicitly if needed","handlingStrategy":"validation","validationCode":"# treat 'not set' as a distinct, expected outcome\nout=$(mise settings get \"$key\" 2>&1) || true\ncase \"$out\" in\n  *'is not set'*) echo \"$key uses its built-in default\";;\n  *) echo \"$key=$out\";;\nesac","typeGuard":"setting_is_set() { mise settings get \"$1\" >/dev/null 2>&1; }","tryCatchPattern":"Handle 'Setting [X] is not set' as the 'unset' answer in probes (distinguish it from 'Unknown setting' which is a hard typo), then apply the documented default in your logic.","preventionTips":["Use `mise settings ls` to see which settings have stored values","Don't assume `settings get` echoes defaults for every key","Set optional settings explicitly if scripts depend on reading them back"],"tags":["settings","config","cli","mise"],"backgroundTag":"missing-config-key","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}