xai-org/grok-build · error
URL cannot be empty.
Error message
URL cannot be empty.
What it means
`grok plugin marketplace add` requires a non-empty URL or path. The input is trimmed and, if empty, the command bails with 'URL cannot be empty.' before any classification or network work.
Source
Thrown at crates/codegen/xai-grok-pager/src/plugin_cmd.rs:854
SourceKind::Git { url, .. } => url.clone(),
SourceKind::Local { path } => path.display().to_string(),
};
println!(" {}: {id}", s.name);
}
}
Ok(())
}
fn marketplace_add(
sources: &[xai_grok_plugin_marketplace::MarketplaceSource],
url: &str,
force: bool,
) -> Result<()> {
use xai_grok_shell::plugin::MarketplaceAddInput;
let url = url.trim();
if url.is_empty() {
bail!("URL cannot be empty.");
}
let cwd = std::env::current_dir().unwrap_or_default();
let input = plugin::classify_marketplace_add_input(url, &cwd);
// Fail fast on missing local paths: otherwise a path input is stored as a git URL and only errors after network clone attempts
if let MarketplaceAddInput::LocalPath(path) = &input
&& !path.is_dir()
{
bail!(
"Local marketplace path not found (or is not a directory): {}",
path.display()
);
}
let identity = match &input {
MarketplaceAddInput::GitUrl(u) => u.clone(),
MarketplaceAddInput::LocalPath(p) => p.display().to_string(),View on GitHub (pinned to bc7f02eddd)
Solutions
- Re-run with the actual marketplace git URL or local path
- Check the env var is set: `echo $MARKETPLACE_URL`
- Quote the argument in scripts: `grok plugin marketplace add "$URL"`
Example fix
// before grok plugin marketplace add $MARKETPLACE_URL # unset → empty // after grok plugin marketplace add "https://github.com/org/marketplace.git"
Defensive patterns
Strategy: validation
Validate before calling
fn ensure_non_empty(input: &str) -> Result<&str, String> {
let t = input.trim();
if t.is_empty() {
return Err("URL cannot be empty".into());
}
Ok(t)
} Type guard
fn is_non_empty(s: &str) -> bool {
!s.trim().is_empty()
} Try / catch
match marketplace_add(input, None, false, false) {
Err(e) if e.to_string().contains("URL cannot be empty") => {
eprintln!("Provide a marketplace URL or local path");
}
Ok(_) => {}
Err(e) => return Err(e),
} Prevention
- Quote shell variables: "$MARKETPLACE_URL"
- Default-check env vars in scripts before invoking the CLI
- Use interactive prompts that reject empty input
When it happens
Trigger: Running `grok plugin marketplace add` with an empty string or whitespace-only argument (e.g. an unset shell variable expands to nothing).
Common situations: `$MARKETPLACE_URL` environment variable unset; script passing empty arg; copy-paste dropped the URL; quoting mistake producing an empty string.
Related errors
- Local marketplace path not found (or is not a directory): {}
- Marketplace source already configured: {identity}
- Provide the source name, git URL, or local path to remove.
- Marketplace source "{filter}" not found.
- no target specified
AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31).
Data as JSON: /api/errors/4a9df57353f2bd63.
Report an issue: GitHub.