{"record":{"id":"87627d3130dd3b55","repo":"xai-org/grok-build","slug":"failed-to-load-manifest-e","errorCode":null,"errorMessage":"Failed to load manifest: {e}","messagePattern":"Failed to load manifest: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/plugin_cmd.rs","lineNumber":709,"sourceCode":"            println!(\"  name: {}\", manifest.name);\n            if let Some(ref v) = manifest.version {\n                println!(\"  version: {v}\");\n            }\n            if let Some(ref d) = manifest.description {\n                println!(\"  description: {d}\");\n            }\n            print_component_summary(&manifest, &root);\n            Ok(())\n        }\n        Ok(ManifestLoadResult::NotFound) => {\n            println!(\n                \"No plugin.json found. Grok discovers skills, agents, and hooks \\\n                 automatically from standard directories. A manifest is only needed \\\n                 for custom paths or metadata.\"\n            );\n            Ok(())\n        }\n        Err(e) => bail!(\"Failed to load manifest: {e}\"),\n    }\n}\n\nfn cmd_tag(path: &str, push: bool, force: bool, dry_run: bool) -> Result<()> {\n    let root = PathBuf::from(path);\n    if !root.is_dir() {\n        bail!(\"Not a directory: {path}\");\n    }\n    let version = match load_manifest(&root) {\n        Ok(ManifestLoadResult::Found(m)) => m.version.ok_or_else(|| {\n            anyhow::anyhow!(\n                \"No `version` field in plugin.json. Set a version to use `grok plugin tag`.\"\n            )\n        })?,\n        Ok(ManifestLoadResult::NotFound) => bail!(\"No plugin.json found in {path}.\"),\n        Err(e) => bail!(\"Failed to load manifest: {e}\"),\n    };\n","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/plugin_cmd.rs#L691-L727","documentation":"`grok plugin validate` failed to read or parse the plugin.json manifest in the target directory. When load_manifest returns an Err (not merely NotFound), the command bails with 'Failed to load manifest: {e}', embedding the underlying parse/IO error. This guards against silently validating a plugin whose metadata is corrupt.","triggerScenarios":"Running `grok plugin validate <path>` where a plugin.json exists but is unreadable (permissions) or invalid JSON/schema, causing load_manifest to return Err.","commonSituations":"Hand-edited plugin.json with a trailing comma or JSON5 syntax; file locked by an editor; wrong file permissions; plugin.json written by a tool emitting non-JSON output.","solutions":["Open plugin.json and fix the JSON syntax error shown in the embedded {e} message","Validate the file with `jq . plugin.json` or a JSON linter","Check file permissions so the current user can read plugin.json","If no manifest is needed, delete plugin.json — validate treats NotFound as OK"],"exampleFix":"// before\n{\n  \"name\": \"my-plugin\",\n  \"version\": \"1.0.0\",\n}\n// after (trailing comma removed)\n{\n  \"name\": \"my-plugin\",\n  \"version\": \"1.0.0\"\n}","handlingStrategy":"validation","validationCode":"use std::path::Path;\nfn manifest_is_valid(dir: &Path) -> Result<(), String> {\n    let f = dir.join(\"plugin.json\");\n    let s = std::fs::read_to_string(&f)\n        .map_err(|e| format!(\"cannot read {}: {e}\", f.display()))?;\n    serde_json::from_str::<serde_json::Value>(&s)\n        .map(|_| ())\n        .map_err(|e| format!(\"invalid plugin.json: {e}\"))\n}","typeGuard":"fn has_readable_manifest(dir: &std::path::Path) -> bool {\n    dir.join(\"plugin.json\").is_file()\n}","tryCatchPattern":"match cmd_validate(dir) {\n    Err(e) if e.to_string().contains(\"Failed to load manifest\") => {\n        eprintln!(\"Fix plugin.json: {e}\");\n    }\n    Ok(_) => {}\n    Err(e) => return Err(e),\n}","preventionTips":["Lint plugin.json with `jq . plugin.json` in CI","Never hand-edit plugin.json without re-validating","Generate the manifest from a schema-checked template"],"tags":["manifest","json","plugin","cli"],"backgroundTag":"manifest-load-failed","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}