xai-org/grok-build · error

{e} Not adding "{url}": it doesn't look like a reachable git

Error message

{e}
Not adding "{url}": it doesn't look like a reachable git repository. Re-run with --force to add it anyway (e.g. a host only reachable on VPN).

What it means

`grok plugin marketplace add <git-url>` probes the remote with `probe_git_remote` before writing config. If the probe fails and `--force` was not passed, the URL is rejected with the underlying git error plus a hint to re-run with `--force` for hosts only reachable on VPN.

Source

Thrown at crates/codegen/xai-grok-pager/src/plugin_cmd.rs:900

    let already_configured = match &input {
        MarketplaceAddInput::GitUrl(git_url) => {
            let normalized = git_url.trim_end_matches(".git");
            sources.iter().any(|s| {
                matches!(&s.kind, SourceKind::Git { url: u, .. }
                    if u.trim_end_matches(".git") == normalized)
            })
        }
        MarketplaceAddInput::LocalPath(path) => sources
            .iter()
            .any(|s| matches!(&s.kind, SourceKind::Local { path: p } if p == path)),
    };
    if already_configured {
        bail!("Marketplace source already configured: {identity}");
    }

    if !force && let MarketplaceAddInput::GitUrl(git_url) = &input {
        xai_grok_plugin_marketplace::git::probe_git_remote(git_url).map_err(|e| {
            anyhow::anyhow!(
                "{e}\nNot adding \"{url}\": it doesn't look like a reachable git repository. \
                 Re-run with --force to add it anyway (e.g. a host only reachable on VPN)."
            )
        })?;
    }

    let name = match &input {
        MarketplaceAddInput::GitUrl(u) => plugin::name_from_url(u),
        MarketplaceAddInput::LocalPath(p) => plugin::name_from_path(p),
    };
    let config_path = xai_grok_config::grok_home().join(xai_grok_config::USER_CONFIG_FILENAME);

    let content = std::fs::read_to_string(&config_path).unwrap_or_default();
    let mut doc: toml_edit::DocumentMut = content
        .parse()
        .map_err(|e| anyhow::anyhow!("Failed to parse config.toml: {e}"))?;

    if doc.get("marketplace").is_none() {

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Fix connectivity/auth so `git ls-remote <url>` works (check URL, VPN, SSH keys, credentials)
  2. If the host is intentionally unreachable from here (VPN-only), re-run with `--force` to add anyway
  3. Verify the URL scheme: use https with a token or ssh with configured keys

Example fix

// before
grok plugin marketplace add git@git.internal.corp:plugins/core.git
// after (host only reachable on VPN)
grok plugin marketplace add --force git@git.internal.corp:plugins/core.git
Defensive patterns

Strategy: fallback

Validate before calling

// pre-check reachability before invoking marketplace add
let probe = std::process::Command::new("git")
    .args(["ls-remote", git_url])
    .status()
    .map(|s| s.success())
    .unwrap_or(false);
if !probe { eprintln!("{git_url} unreachable; use --force if VPN-only"); }

Try / catch

match marketplace_add_result {
    Err(e) if e.to_string().contains("reachable git repository") => {
        eprintln!("remote unreachable; fix network/SSH or re-run with --force");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Adding a marketplace source as a git URL when: the remote doesn't exist, credentials are missing, SSH keys aren't set up, DNS fails, or the host is only reachable via VPN — all without passing `--force`.

Common situations: Corporate/VPN-only git hosts; typo'd URL; missing SSH key for git@ URLs; offline laptop; private repo without auth configured.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/6f3e434b2f91a26e. Report an issue: GitHub.