{"record":{"id":"c42968ebf37a1979","repo":"jdx/mise","slug":"config-file-not-found-c42968","errorCode":null,"errorMessage":"config file not found: {}","messagePattern":"config file not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/config/set.rs","lineNumber":77,"sourceCode":"                })?;\n                (k.to_string(), v.to_string())\n            }\n        };\n        // 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 => top_toml_config(),\n        };\n        let Some(file) = file else {\n            bail!(\"No mise.toml file found\");\n        };\n        if !file.exists() {\n            bail!(\"config file not found: {}\", display_path(&file));\n        }\n        let mut config: toml_edit::DocumentMut = std::fs::read_to_string(&file)?.parse()?;\n        let mut container = config.as_item_mut();\n        let parts = full_key.split('.').collect::<Vec<&str>>();\n        let last_key = parts.last().unwrap();\n        for (idx, part) in parts.iter().take(parts.len() - 1).enumerate() {\n            container = container\n                .as_table_like_mut()\n                .ok_or_else(|| {\n                    eyre::eyre!(\n                        \"cannot set '{full_key}': '{}' is already set to a non-table value\",\n                        parts[..idx].join(\".\")\n                    )\n                })?\n                .entry(part)\n                .or_insert({\n                    let mut t = toml_edit::Table::new();\n                    t.set_implicit(true);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/config/set.rs#L59-L95","documentation":"mise config set resolved an explicit --file target but the path does not exist on disk (src/cli/config/set.rs:77). Set refuses to create files implicitly - writing into a guessed layout could clobber the user's intended config structure - so the file must already be there.","triggerScenarios":"'mise config set --file ./envs/prod/mise.toml key value' with the file missing; --file given a directory that contains no config; path typos; relative paths resolved from an unexpected cwd.","commonSituations":"Scripts assuming a target env config exists; freshly cloned repos with gitignored local configs; pipeline steps that run before the scaffolding step.","solutions":["Create the file first (touch) or point --file at an existing config","If a directory was passed, ensure it actually contains a mise.toml","Use absolute paths in scripts","Add a one-time scaffolding step to repo setup, then let scripts set values"],"exampleFix":"# before\nmise config set --file envs/prod/mise.toml env.FOO bar\n# Error: config file not found: envs/prod/mise.toml\n\n# after\ntouch envs/prod/mise.toml\nmise config set --file envs/prod/mise.toml env.FOO bar","handlingStrategy":"validation","validationCode":"# bash: refuse to run set against a missing --file target\n[ -f \"$FILE\" ] || [ -f \"$FILE/mise.toml\" ] || { echo \"refusing: $FILE does not exist\" >&2; exit 1; }\nmise config set --file \"$FILE\" \"$KEY\" \"$VALUE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scaffold env config files once in repo setup","Use absolute paths for --file in scripts"],"tags":["mise","config","file-not-found","cli-args"],"backgroundTag":"config-file-not-found","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}