{"record":{"id":"3fe95d375aab11d8","repo":"jdx/mise","slug":"config-file-not-found","errorCode":null,"errorMessage":"config file not found: {}","messagePattern":"config file not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/config/get.rs","lineNumber":62,"sourceCode":"        // Only an explicitly named target goes through the shared resolver — the default is a\n        // different rule (the top TOML config of the loaded set, not the nearest writable one).\n        let file = match self.file {\n            Some(path) => Some(resolve_target_config_path(ConfigPathOptions {\n                path: Some(path),\n                prefer_toml: true,\n                ..Default::default()\n            })?),\n            None if self.global => Some(resolve_target_config_path(ConfigPathOptions {\n                global: true,\n                prefer_toml: true,\n                ..Default::default()\n            })?),\n            None if self.system => Some(system_config_path()),\n            None => top_toml_config(),\n        };\n        if let Some(file) = file {\n            if !file.exists() {\n                bail!(\"config file not found: {}\", display_path(&file));\n            }\n            let content = std::fs::read_to_string(&file)?;\n            let config: toml::Value = toml::de::from_str(&content)?;\n            let mut value = &config;\n            if let Some(key) = &self.key {\n                for k in key.split('.') {\n                    value = value.get(k).ok_or_else(|| {\n                        eyre::eyre!(\"Key not found: {} in {}\", key, display_path(&file))\n                    })?;\n                }\n            }\n\n            match value {\n                toml::Value::String(s) => miseprintln!(\"{}\", s),\n                toml::Value::Integer(i) => miseprintln!(\"{}\", i),\n                toml::Value::Boolean(b) => miseprintln!(\"{}\", b),\n                toml::Value::Float(f) => miseprintln!(\"{}\", f),\n                toml::Value::Datetime(d) => miseprintln!(\"{}\", d),","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/config/get.rs#L44-L80","documentation":"`mise config get` resolves which config file to read: an explicitly selected file, the system config, or the top-level TOML config. When the resolved file path does not exist on disk, mise bails with this error instead of reading it. This guards against reporting settings from a stale or missing path.","triggerScenarios":"`mise config get` (optionally with `--system` or a file selection) when the resolved config path doesn't exist: `--system` used but no system config was ever created, an explicitly chosen file was deleted, or `top_toml_config()` returned a path that was removed after being referenced.","commonSituations":"New machines or CI containers where no mise.toml exists yet; users running `mise config get --system` expecting defaults to exist; deleted global config after cleanup scripts.","solutions":["Check the reported path and create the file if you intend it to exist (`mise config set -g key val` creates the global one)","Run without `--system` or without the missing-file selector to read an existing config instead","Initialize a mise.toml in the project (`mise use node@20` writes one)","Verify you are in the directory containing the config you expect"],"exampleFix":"// before\n$ mise config get --system  # fails: no system config exists\n// after\n$ mise config get           # reads the nearest existing config\n# or create it: mise config set --system tools.node \"20\"","handlingStrategy":"fallback","validationCode":"[ -f \"${MISE_CONFIG:-mise.toml}\" ] || [ -f \"$HOME/.config/mise/config.toml\" ] || echo \"no config exists yet\"","typeGuard":"has_config() { [ -f mise.toml ] || [ -f .mise.toml ] || [ -f \"$HOME/.config/mise/config.toml\" ]; }","tryCatchPattern":"mise config get \"$key\" 2>/dev/null || echo \"(no config / unset)\"","preventionTips":["Create a global config early (`mise use -g ...`) so a readable file always exists","Don't use `--system` unless you've created a system config","Check `mise config ls` to see detected files","Handle the not-found case in scripts when reading optional settings"],"tags":["config","cli","file-not-found"],"backgroundTag":"config-file-not-found","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"}