xai-org/grok-build · error
Provide the source name, git URL, or local path to remove.
Error message
Provide the source name, git URL, or local path to remove.
What it means
The marketplace `remove` command requires an argument identifying the source to remove. When the trimmed argument is empty (empty string or whitespace only), it bails immediately before any lookup. The library throws this to fail fast rather than guessing a source.
Source
Thrown at crates/codegen/xai-grok-pager/src/plugin_cmd.rs:1010
let names: Vec<&str> = sources.iter().map(|s| s.name.as_str()).collect();
if names.is_empty() {
format!("Marketplace source \"{input}\" not found; no sources are configured.")
} else {
format!(
"Marketplace source \"{input}\" not found. Configured sources: {}",
names.join(", ")
)
}
})
}
fn marketplace_remove(
sources: &[xai_grok_plugin_marketplace::MarketplaceSource],
name_or_url: &str,
) -> Result<()> {
let input = name_or_url.trim();
if input.is_empty() {
bail!("Provide the source name, git URL, or local path to remove.");
}
let cwd = std::env::current_dir().unwrap_or_default();
let source = find_removal_source(sources, input, &cwd).map_err(|e| anyhow::anyhow!("{e}"))?;
let identity = source_identity(source);
let uninstalled = plugin::uninstall_marketplace_source_plugins(&identity);
let config_path = xai_grok_config::grok_home().join(xai_grok_config::USER_CONFIG_FILENAME);
let mut removed_from_config = false;
if let Ok(content) = std::fs::read_to_string(&config_path)
&& let Some(new) = plugin::remove_toml_marketplace_block(&content, &identity)
{
if let Err(e) = std::fs::write(&config_path, new) {
tracing::warn!("failed to write config.toml: {e}");
} else {
removed_from_config = true;
}View on GitHub (pinned to bc7f02eddd)
Solutions
- Pass the source name, git URL, or local path: `grok marketplace remove <name-or-url>`.
- Run `grok marketplace list` to see valid identifiers.
- In scripts, guard the argument: `[ -n "$SRC" ] || { echo 'missing source'; exit 1; }` before invoking.
Example fix
// before grok marketplace remove "$SRC" # SRC empty // after [ -n "$SRC" ] && grok marketplace remove "$SRC"
Defensive patterns
Strategy: validation
Validate before calling
if src.trim().is_empty() {
eprintln!("usage: grok marketplace remove <name|git-url|local-path>");
std::process::exit(2);
} Prevention
- Always pass a non-empty positional argument to `marketplace remove`.
- In shell scripts, quote and check variables before use: `[ -n "$SRC" ]`.
- Avoid `set -u` pitfalls by defaulting: SRC="${1:-}" and validating.
When it happens
Trigger: Calling marketplace_remove with name_or_url that is empty or whitespace-only after trim — e.g. `grok marketplace remove ""` or `grok marketplace remove " "`.
Common situations: Shell variable interpolation producing an empty value (unset env var in a script); accidentally passing a bare flag; copy-paste dropping the argument.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- no target specified
- URL cannot be empty.
- Local marketplace path not found (or is not a directory): {}
- Marketplace source already configured: {identity}
- Marketplace source "{filter}" not found.
AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31).
Data as JSON: /api/errors/030624522dd7eb4d.
Report an issue: GitHub.