xai-org/grok-build · error
Manifest validation failed: {e}
Error message
Manifest validation failed: {e} What it means
`grok plugin validate <path>` loads the plugin's plugin.json manifest and calls `manifest.validate()`. Any rule violation (invalid name, missing/wrong fields, bad format) is surfaced as "Manifest validation failed". It means the manifest exists but does not satisfy the plugin schema requirements.
Source
Thrown at crates/codegen/xai-grok-pager/src/plugin_cmd.rs:689
if let Ok(ManifestLoadResult::Found(manifest)) = load_manifest(&repo.path) {
if let Some(ref desc) = manifest.description {
println!(" description: {desc}");
}
print_component_summary(&manifest, &repo.path);
}
Ok(())
}
fn cmd_validate(path: &str) -> Result<()> {
let root = PathBuf::from(path);
if !root.is_dir() {
bail!("Not a directory: {path}");
}
match load_manifest(&root) {
Ok(ManifestLoadResult::Found(manifest)) => {
manifest
.validate()
.map_err(|e| anyhow::anyhow!("Manifest validation failed: {e}"))?;
println!("Plugin manifest is valid.");
println!(" name: {}", manifest.name);
if let Some(ref v) = manifest.version {
println!(" version: {v}");
}
if let Some(ref d) = manifest.description {
println!(" description: {d}");
}
print_component_summary(&manifest, &root);
Ok(())
}
Ok(ManifestLoadResult::NotFound) => {
println!(
"No plugin.json found. Grok discovers skills, agents, and hooks \
automatically from standard directories. A manifest is only needed \
for custom paths or metadata."
);
Ok(())View on GitHub (pinned to bc7f02eddd)
Solutions
- Read the `{e}` detail in the message — it names the exact failing rule — and fix that field in plugin.json
- Run `grok plugin validate <dir>` again after each fix to iterate
- Regenerate the manifest from a current plugin template/scaffold if unsure of the expected schema
- Check whether a recent grok upgrade changed manifest requirements
Example fix
// before (plugin.json)
{ "name": "My Plugin!" }
// after
{ "name": "my-plugin", "version": "0.1.0", "description": "..." } Defensive patterns
Strategy: validation
Validate before calling
// pre-check manifest fields before calling validate
let m: serde_json::Value = serde_json::from_str(&std::fs::read_to_string("plugin.json")?)?;
assert!(!m["name"].as_str().unwrap_or_default().is_empty(), "name required");
assert!(m["name"].as_str().map_or(false, |n| n.chars().all(|c| c.is_ascii_lowercase() || c == '-' || c.is_ascii_digit())), "name must be kebab-case"); Try / catch
match manifest.validate() {
Ok(()) => println!("valid"),
Err(e) => eprintln!("manifest invalid: {e}; fix plugin.json and re-run grok plugin validate"),
} Prevention
- Run `grok plugin validate` in CI for every plugin change
- Generate manifests from the official template instead of hand-writing them
- Re-validate after every grok upgrade in case schema rules tightened
When it happens
Trigger: Calling `grok plugin validate <dir>` where plugin.json parses (ManifestLoadResult::Found) but `Manifest::validate()` returns an error — e.g. invalid `name` characters, missing required field, malformed version, empty description constraints.
Common situations: Hand-editing plugin.json and introducing invalid values; scaffolding a plugin manually instead of via a template; schema requirements tightened by a newer grok version so an older manifest no longer validates.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Failed to load manifest: {e}
- No plugin.json found in {path}.
- No `version` field in plugin.json. Set a version to use `gro
- invalid worktree id from dest: {worktree_id}
- invalid worktree id {:?}
AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31).
Data as JSON: /api/errors/6df7aa06b7f9b6a7.
Report an issue: GitHub.