{"record":{"id":"6ffd3cbbc9c25082","repo":"jdx/mise","slug":"path-path-raw-must-be-absolute-or-start-with","errorCode":null,"errorMessage":"path \"{path_raw}\" must be absolute or start with ~/, ignoring entry","messagePattern":"path \"(.+?)\" must be absolute or start with ~/, ignoring entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/edits.rs","lineNumber":268,"sourceCode":"\nfn split_edit_key(path_and_id: &str) -> Option<(String, String)> {\n    let (path, id) = path_and_id.rsplit_once('/')?;\n    if path.is_empty() || path == \"~\" || path == \"/\" || id.is_empty() {\n        return None;\n    }\n    Some((path.to_string(), id.to_string()))\n}\n\nfn resolve_entry(\n    path_raw: &str,\n    id: String,\n    entry: EditTomlEntry,\n    base: &Path,\n    config_path: &Path,\n) -> Result<EditRequest> {\n    let path = file::replace_path(path_raw);\n    if path.is_relative() {\n        bail!(\"path \\\"{path_raw}\\\" must be absolute or start with ~/, ignoring entry\");\n    }\n    // ids end up inside marker lines — keep them to characters that can't\n    // collide with the marker syntax itself\n    if id.is_empty() || !id.chars().all(|c| c.is_alphanumeric() || \"_-.\".contains(c)) {\n        bail!(\n            \"\\\"{path_raw}\\\".{id:?}: ids may only contain letters, digits, '_', '-', and '.', ignoring entry\"\n        );\n    }\n    let mut origin = ResourceOrigin {\n        config: config_path.to_path_buf(),\n        config_root: crate::config::config_file::config_root::config_root(config_path),\n        environment: crate::config::environments_for_config_path(config_path),\n        source: None,\n    };\n    let entry = match entry {\n        EditTomlEntry::Block(inline) => EditTomlTable {\n            block: Some(inline),\n            source: None,","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/edits.rs#L250-L286","documentation":"Validation in `resolve_entry` for dotfile edit entries: the entry's `path` resolves to a relative filesystem path (not absolute and not starting with `~/`), which would be ambiguous against the working directory, so the entry is rejected.","triggerScenarios":"An [[edit]]-style TOML entry whose path is e.g. `dotfiles/zshrc` or `./zshrc` — anything that after `file::replace_path` is still relative — passed into `resolve_entry` from `edits_from_config_files`.","commonSituations":"Authors assuming paths are resolved relative to the config file's directory; using `~` without the slash (e.g. `~user/...` handled oddly); environment-variable expansion that produces an empty prefix leaving a relative path.","solutions":["Make the path absolute: `/home/me/dotfiles/zshrc`, or home-relative: `~/dotfiles/zshrc`.","If you meant a path relative to the config file, expand it yourself or use the documented `{{ config_root }}` templating instead of a bare relative path.","Check any env-var/tilde expansion in the path value that may be stripping the leading `/` or `~/`."],"exampleFix":"# before\n[[edits]]\npath = \"dotfiles/zshrc\"\nid = \"alias\"\n# after\n[[edits]]\npath = \"~/dotfiles/zshrc\"\nid = \"alias\"","handlingStrategy":"validation","validationCode":"let p = shellexpand::tilde(&raw);\nassert!(std::path::Path::new(p.as_ref()).is_absolute(), \"edit path must be absolute or start with ~/: {raw}\");","typeGuard":"fn is_editable_path(raw: &str) -> bool {\n    raw.starts_with(\"~/\") || std::path::Path::new(shellexpand::tilde(raw).as_ref()).is_absolute()\n}","tryCatchPattern":null,"preventionTips":["Always write edit paths as absolute or `~/`-prefixed.","Don't assume paths are relative to the config file location.","Verify env-var expansion doesn't strip the leading `/` or `~/`."],"tags":["dotfiles","path-validation","config"],"backgroundTag":"invalid-config-value","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"}