{"record":{"id":"5d0d286ceefaef00","repo":"jdx/mise","slug":"relative-repo-paths-are-only-allowed-in-a-project","errorCode":null,"errorMessage":"relative repo paths are only allowed in a project config; use an absolute path or a `~/` path","messagePattern":"relative repo paths are only allowed in a project config; use an absolute path or a `~/` path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/repos.rs","lineNumber":90,"sourceCode":"}\n\nimpl RepoRequest {\n    pub(crate) fn from_toml(\n        path_raw: String,\n        config: RepoTomlConfig,\n        project_root: Option<&Path>,\n    ) -> Result<Self> {\n        if path_raw.starts_with('~') && !path_raw.starts_with(\"~/\") {\n            bail!(\n                \"repo path `{path_raw}` cannot start with `~`; use `~/` for a home-relative path\"\n            );\n        }\n        let path = file::replace_path(&path_raw);\n        let path = if path.is_absolute() {\n            path\n        } else {\n            let Some(root) = project_root else {\n                bail!(\n                    \"relative repo paths are only allowed in a project config; use an absolute path or a `~/` path\"\n                );\n            };\n            if path.components().any(|component| {\n                matches!(\n                    component,\n                    Component::ParentDir | Component::RootDir | Component::Prefix(_)\n                )\n            }) {\n                bail!(\n                    \"relative repo path `{path_raw}` must stay within the project root (no `..` or absolute segments)\"\n                );\n            }\n            if !path\n                .components()\n                .any(|component| matches!(component, Component::Normal(_)))\n            {\n                bail!(","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/repos.rs#L72-L108","documentation":"A relative `path` in a `[repos]` entry can only be resolved against a project root, which exists only when the config is part of a project (e.g. a `mise.toml` in the repo). When `RepoRequest::from_toml` is called with `project_root = None` (global/user-level config) and the path is relative, mise cannot anchor it and rejects the value, telling you to use an absolute or `~/` path instead.","triggerScenarios":"Declaring a relative repo `path` (after tilde expansion) in a global config file such as `~/.config/mise/config.toml`, where no project_root is passed to `RepoRequest::from_toml`.","commonSituations":"Moving a repos entry from a project `mise.toml` into the global config without converting `path = \"config-repo\"` to an absolute or `~/` path; writing global shared repo definitions assuming a cwd-relative resolution that mise intentionally does not perform.","solutions":["Make the path home-relative in the global config: `path = \"~/src/config-repo\"`.","Or use a fully absolute path: `path = \"/opt/repos/config-repo\"`.","Or keep the relative path but move the entry back into a project-level `mise.toml` where a project root exists.","Note: even in project configs, the relative path must stay within the project root (no `..` segments)."],"exampleFix":"# before (global config.toml)\n[repos]\npath = \"config-repo\"\n\n# after\n[repos]\npath = \"~/src/config-repo\"","handlingStrategy":"validation","validationCode":"const isRelative = repoPath && !repoPath.startsWith('/') && !repoPath.startsWith('~/');\nif (isRelative && !isProjectConfig) throw new Error('relative repo path requires a project config; use /abs or ~/ in global config');","typeGuard":null,"tryCatchPattern":"try {\n  parseRepoToml(cfg, { projectRoot: null });\n} catch (e) {\n  if (/relative repo paths are only allowed in a project config/.test(String(e.cause ?? e))) {\n    console.error('move the entry to a project mise.toml or make the path absolute/home-relative');\n  }\n  throw e;\n}","preventionTips":["In global/user config, only use absolute or `~/` repo paths","Reserve relative paths for project-level mise.toml files, and keep them inside the project root","When copying repo entries between configs, convert relative paths first"],"tags":["configuration","path","relative-path","toml"],"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"}