{"record":{"id":"959ce24f7d3027dc","repo":"jdx/mise","slug":"path-does-not-exist-mise-resolves-this-to-a-tr","errorCode":null,"errorMessage":"Path does not exist: {}\nmise resolves this to a trust root before recording anything, and that resolution is lexical — a path that is not there would act on its parent directory instead.","messagePattern":"Path does not exist: (.+?)\nmise resolves this to a trust root before recording anything, and that resolution is lexical — a path that is not there would act on its parent directory instead\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/trust.rs","lineNumber":220,"sourceCode":"}\n\n/// The config file a user-supplied path refers to, or `None` when none was given.\n///\n/// The path has to exist. Trusting is not done against the path as typed: it is resolved to a\n/// trust root first, and `config_root` does that by counting path components, never by looking at\n/// the filesystem. A path that is not there therefore used to resolve to its *parent*, and mise\n/// would trust or untrust that instead — exit 0, `trusted <parent>`, and a typo silently granting\n/// trust to a directory nobody named.\n///\n/// Existence is the whole check. A directory with no config file in it yet still resolves, since\n/// its trust root is the directory itself and trusting a project before writing its `mise.toml`\n/// is a real thing to want.\npub(super) fn resolve_config_file(config_file: Option<&PathBuf>) -> Result<Option<PathBuf>> {\n    let Some(config_file) = config_file else {\n        return Ok(None);\n    };\n    if !config_file.exists() {\n        bail!(\n            \"Path does not exist: {}\\n\\\n             mise resolves this to a trust root before recording anything, and that resolution is \\\n             lexical — a path that is not there would act on its parent directory instead.\",\n            display_path(config_file)\n        );\n    }\n    Ok(Some(if config_file.is_dir() {\n        config_files_in_dir(config_file)\n            .last()\n            .cloned()\n            .unwrap_or(config_file.join(&*env::MISE_DEFAULT_CONFIG_FILENAME))\n    } else {\n        config_file.clone()\n    }))\n}\n\nimpl Trust {\n    fn ignore(&self) -> Result<()> {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/trust.rs#L202-L238","documentation":"`mise trust <path>` resolves the given config path lexically to determine its trust root before recording trust. If the path does not exist, resolution could silently act on a parent directory, so mise refuses up front with this error.","triggerScenarios":"Running `mise trust ./mise.toml` (or a directory path) where the file/dir does not exist — wrong cwd, deleted config, or a path typo; trusting a config before a repo checkout completes.","commonSituations":"Trust command copy-pasted from docs for a filename that differs (mise.toml vs .mise.toml vs mise.local.toml); running from the wrong directory in scripts; trusting a path a previous cleanup removed.","solutions":["cd to the project directory and run `mise trust` with no argument to trust the detected config","Verify the exact config filename: ls mise.toml .mise.toml mise.local.toml and trust the one that exists","Create the missing config first (mise init) if you intended to trust a new project"],"exampleFix":"// before\nmise trust ./msie.toml\n// after\nmise trust ./mise.toml   # or just `mise trust` inside the project","handlingStrategy":"validation","validationCode":"const { existsSync } = require('fs');\nconst cfg = ['mise.toml','.mise.toml','mise.local.toml'].find(existsSync);\nif (!cfg) throw new Error('no mise config file found in cwd; run mise init');\nexec(`mise trust ${cfg}`);","typeGuard":"const isExistingPath = (p: string): p is string => existsSync(p);","tryCatchPattern":"try { exec('mise trust ' + p); } catch (e) { if (String(e).startsWith('Path does not exist')) { console.error('run `mise trust` inside the project or fix the path'); } throw e; }","preventionTips":["Run `mise trust` with no argument from the project root to trust the detected config","Confirm the exact config filename with ls before trusting a path","Re-check trust commands in scripts after renames (mise.toml vs .mise.toml)"],"tags":["cli","trust","path","file-not-found"],"backgroundTag":"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"}