jdx/mise · error

github_content package requires `path`

Error message

github_content package requires `path`

What it means

Aqua packages of type github_content serve files directly from a GitHub repository, so the package definition must specify which `path` within the repo to fetch. resolve_lock_info bails when such a package lacks `path`, since no URL can be constructed without it.

Source

Thrown at src/backend/aqua.rs:859

                        }
                    }
                }
                result
            }
            AquaPackageType::GithubArchive => (
                Some(self.github_archive_url(&pkg, &v)),
                Some(self.github_archive_api_url(&pkg, &v)),
                None,
            ),
            AquaPackageType::GithubContent => {
                if pkg.path.is_some() {
                    (
                        Some(self.github_content_url(&pkg, &v)),
                        Some(self.github_content_api_url(&pkg, &v)),
                        None,
                    )
                } else {
                    bail!("github_content package requires `path`")
                }
            }
            AquaPackageType::Http => {
                let (url, resolved_version) =
                    resolve_aqua_http_url(&pkg, &v, v_prefixed.as_deref(), target_os, target_arch)
                        .await?;
                v = resolved_version;
                (Some(url), None, None)
            }
            _ => (None, None, None),
        };

        let name = url.as_ref().map(|u| get_filename_from_url(u));
        if let Some(filename) = &name {
            pkg = Self::apply_selected_asset_libc_replacement(pkg, target_os, filename);
        }

        // Try to get checksum from checksum file if not available from GitHub API

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Add the required `path` field to the package TOML (e.g. path = "install.sh" or the binary's path in the repo).
  2. Fix the typo if a misspelled key was used, and validate the TOML against the aqua package schema.
  3. Pin a working version of the aqua-registry package or fix the entry upstream if it comes from aqua-registry.

Example fix

// before
packages = ["github_content/example/3.2.1"]  # package TOML lacks `path`
// after (aqua package TOML)
[package]
type = "github_content"
repo_owner = "example"
repo_name = "example"
path = "bin/example.sh"  # required for github_content packages
Defensive patterns

Strategy: validation

Validate before calling

fn github_content_ok(pkg: &toml::Value) -> bool {
    pkg.get("type").and_then(|t| t.as_str()) != Some("github_content")
        || pkg.get("path").and_then(|p| p.as_str()).map(|s| !s.is_empty()).unwrap_or(false)
}

Try / catch

match resolve_lock_info(pkg) {
    Ok(info) => use(info),
    Err(e) if e.to_string().contains("github_content package requires `path`") => {
        eprintln!("add `path` to the github_content package definition");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Resolving lock info for an aqua package with package_type github_content whose TOML defines repo_owner/repo_name but omits the `path` field.

Common situations: Hand-written or copied aqua package entry missing the `path` key; upstream aqua-registry entry changed/removed `path`; typo like `paths` instead of `path`.

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@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/146030ee5c405412. Report an issue: GitHub.