jdx/mise · error

must set `url`

Error message

must set `url`

What it means

Each `[bootstrap.repos]` entry must set a `url` key; from_toml unwraps config.url after trimming and bails when it is absent (None). The URL is the git remote used to clone/update the repo, so it is mandatory. The error message intentionally references the TOML key `url`.

Solutions

  1. Add `url = "<git-remote>"` to the repo entry
  2. Check the key spelling is exactly `url` (not `uri`, `repo`, or `source`)
  3. Remove the entry if the repo is no longer needed

Example fix

// before
[bootstrap.repos]
"~/src/dotfiles" = { ref = "main" }
// after
[bootstrap.repos]
"~/src/dotfiles" = { url = "https://github.com/jdx/dotfiles.git", ref = "main" }
Defensive patterns

Strategy: validation

Validate before calling

function validateRepoEntry(key, entry) {
  if (!entry || typeof entry.url !== 'string') {
    throw new Error(`[bootstrap.repos] "${key}" must set url`);
  }
}

Try / catch

match result {
    Err(e) if e.to_string().contains("must set `url`") => eprintln!("add url = ... to the repo entry: {e}"),
    Err(e) => return Err(e),
    Ok(v) => v,
}

Prevention

When it happens

Trigger: Writing `{ ref = "main" }` or an empty table `{}` as the repo value in `[bootstrap.repos]`, omitting `url = "..."`.

Common situations: Hand-editing mise.toml and forgetting the url key; a typo like `uri =` or `repo =` instead of `url`; generating config programmatically and skipping the field.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/b357a81916617694. Report an issue: GitHub.

Appendix: source

Thrown at src/system/repos.rs:124

                .any(|component| matches!(component, Component::Normal(_)))
            {
                bail!(
                    "relative repo path `{path_raw}` must name a directory inside the project root"
                );
            }
            // Join only the Normal segments so `./foobar` resolves to
            // `<root>/foobar` rather than `<root>/./foobar` — a `.` component
            // survives `Path::join` and leaks into every displayed path.
            let mut resolved = root.to_path_buf();
            for component in path.components() {
                if let Component::Normal(segment) = component {
                    resolved.push(segment);
                }
            }
            resolved
        };
        let Some(url) = config.url.map(|s| s.trim().to_string()) else {
            bail!("must set `url`");
        };
        if url.is_empty() {
            bail!("must set a non-empty `url`");
        }
        if url.starts_with('-') {
            bail!("`url` must not start with `-`");
        }
        let git_ref = config.git_ref.map(|s| s.trim().to_string());
        let git_ref = match git_ref {
            Some(git_ref) if git_ref.is_empty() => bail!("`ref` must not be empty"),
            Some(git_ref) if git_ref.starts_with('-') => bail!("`ref` must not start with `-`"),
            other => other,
        };
        Ok(Self {
            path_raw,
            path,
            url,
            git_ref,

View on GitHub (pinned to 533346cc37)