{"record":{"id":"a6d8dd21a0d30c9d","repo":"jdx/mise","slug":"agent-name-queue-directories-entry-dir-m","errorCode":null,"errorMessage":"agent '{name}' `queue_directories` entry '{dir}' must be an absolute path (launchd requires absolute paths; `~` and `~/` are expanded)","messagePattern":"agent '(.+?)' `queue_directories` entry '(.+?)' must be an absolute path \\(launchd requires absolute paths; `~` and `~/` are expanded\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/launchd.rs","lineNumber":138,"sourceCode":"        if config.keep_alive && config.keep_alive_on_failure {\n            bail!(\"agent '{name}' cannot set both `keep_alive` and `keep_alive_on_failure`\");\n        }\n        if config.nice.is_some_and(|nice| !(-20..=20).contains(&nice)) {\n            bail!(\"agent '{name}' `nice` must be between -20 and 20\");\n        }\n        if let Some(interval) = &config.start_calendar_interval {\n            interval.validate(&name)?;\n        }\n        for dir in &config.queue_directories {\n            if dir.trim().is_empty() {\n                bail!(\"agent '{name}' `queue_directories` must not contain empty entries\");\n            }\n            // checked against the raw string rather than `Path::is_absolute` on the\n            // expanded value: the plist is consumed by macOS launchd, so POSIX rules\n            // apply regardless of the platform parsing the config, and on Windows\n            // `Path::new(\"/var/spool\").is_absolute()` is false (root, but no prefix)\n            if !is_absolute_launchd_path(dir) {\n                bail!(\n                    \"agent '{name}' `queue_directories` entry '{dir}' must be an absolute path \\\n                     (launchd requires absolute paths; `~` and `~/` are expanded)\"\n                );\n            }\n        }\n        Ok(Self {\n            label: format!(\"dev.mise.{name}\"),\n            name,\n            program,\n            args: config.args,\n            run_at_load: config.run_at_load,\n            keep_alive: config.keep_alive,\n            keep_alive_on_failure: config.keep_alive_on_failure,\n            start_interval: config.start_interval,\n            throttle_interval: config.throttle_interval,\n            nice: config.nice,\n            start_calendar_interval: config.start_calendar_interval,\n            queue_directories: config.queue_directories,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/launchd.rs#L120-L156","documentation":"launchd requires queue directory watch paths to be absolute POSIX paths; the plist is consumed by macOS launchd regardless of which platform parses the config. LaunchdRequest::from_toml checks each queue_directories entry with is_absolute_launchd_path() against the raw string and bails with this message for relative paths, explaining that `~` and `~/` prefixes are expanded. On Windows, Path::is_absolute would wrongly reject root-relative POSIX paths, hence the custom check.","triggerScenarios":"A queue_directories entry like \"spool/mail\" or \"./data\" that is neither absolute, nor `~`/`~/`-prefixed, and cannot be expanded to an absolute path.","commonSituations":"Writing relative paths assuming they resolve relative to the config file; using Windows-style absolute paths ('C:\\\\data') in a launchd plist; forgetting the leading '/' or '~'.","solutions":["Prefix the entry with '/' to make it an absolute POSIX path","Use '~/...' paths, which are expanded to the user's home directory","On Windows-authored configs, still write POSIX-style paths since launchd runs on macOS"],"exampleFix":"# before\nqueue_directories = [\"spool/mail\"]\n# after\nqueue_directories = [\"/var/spool/mail\"]","handlingStrategy":"validation","validationCode":"import os\nfor d in agent_cfg.get(\"queue_directories\", []):\n    assert d.startswith((\"/\", \"~/\")) or d == \"~\", f\"'{d}' must be absolute or ~-prefixed\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write launchd paths as absolute POSIX paths","Use ~/ for home-relative directories","Never use Windows-style paths in launchd agent configs"],"tags":["launchd","config","path-validation"],"backgroundTag":"invalid-argument-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"}