{"record":{"id":"f30ad62e13fd6069","repo":"iOfficeAI/OfficeCLI","slug":"plugin-failed","errorCode":"plugin_failed","errorMessage":"Plugin '{resolved.Manifest.Name}' dump failed (exit {runResult.ExitCode}) on fixture '{fixturePath}': {TruncateForLint(runResult.Stderr, 500)}","messagePattern":"Plugin '(.+?)' dump failed \\(exit (.+?)\\) on fixture '(.+?)': (.+?)","errorType":"exception","errorClass":"CliException","httpStatus":null,"severity":"error","filePath":"src/officecli/CommandBuilder.Plugins.cs","lineNumber":315,"sourceCode":"                items.Add(item);\n            }\n\n            var idle = resolved.Manifest.ResolveIdleTimeout(\"dump\");\n            var runResult = PluginProcess.Run(new PluginProcess.RunOptions\n            {\n                ExecutablePath = resolved.ExecutablePath,\n                Arguments = new[] { \"dump\", fixturePath },\n                IdleTimeoutSeconds = idle,\n                OnStdoutLine = OnLine,\n            });\n            if (PluginProcess.LineCallbackError is CliException ce) throw ce;\n            if (PluginProcess.LineCallbackError is not null) throw PluginProcess.LineCallbackError;\n            if (runResult.IdleTimedOut)\n                throw new CliException(\n                    $\"Plugin '{resolved.Manifest.Name}' produced no output for {idle}s — likely hung.\")\n                { Code = \"plugin_idle_timeout\" };\n            if (runResult.ExitCode != 0)\n                throw new CliException(\n                    $\"Plugin '{resolved.Manifest.Name}' dump failed (exit {runResult.ExitCode}) on fixture '{fixturePath}': {TruncateForLint(runResult.Stderr, 500)}\")\n                { Code = \"plugin_failed\" };\n\n            // Validate both add and set props against the target-format\n            // schema. BatchItem.Type is used verbatim as the schema element\n            // name for add; set commands look up the element via the path's\n            // leaf type when available, falling back to lenient validation\n            // when the schema doesn't recognize the inferred element.\n            for (int i = 0; i < items.Count; i++)\n            {\n                var it = items[i];\n                if (it is null) continue;\n                var verb = (it.Command ?? \"\").ToLowerInvariant();\n                if (verb != \"add\" && verb != \"set\") continue;\n                if (it.Props == null || it.Props.Count == 0) continue;\n\n                // For add: explicit Type. For set: best-effort infer from the\n                // last segment of the path (e.g. \"/p[1]/r[2]\" → \"r\"). This","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/CommandBuilder.Plugins.cs#L297-L333","documentation":"The plugin exited with a non-zero code after running 'dump <fixture>'. The message includes the exit code and up to 500 chars of the plugin's stderr (TruncateForLint) to surface the failure reason.","triggerScenarios":"A dump-reader plugin crashes (uncaught exception), returns a non-zero exit on an unsupported fixture, or explicitly errors out.","commonSituations":"Fixture format the plugin does not handle; plugin bug/exception; missing native dependency the plugin needs to parse the fixture.","solutions":["Read the included stderr (up to 500 chars) for the plugin's error.","Run '<plugin> dump <fixture>' directly to reproduce and debug.","Fix the plugin or supply a fixture it supports."],"exampleFix":"# before: plugin exits 1 on the fixture\n# reproduce directly:\n./my-reader dump samples/tiny.foreign ; echo \"exit=$?\"\n# fix the parser, then:\nofficecli plugins lint my-reader","handlingStrategy":"try-catch","validationCode":"// Pre-flight: run the plugin dump and require exit 0 before lint.\nusing var proc = Process.Start(plugin, $\"dump {fixture}\");\nproc.WaitForExit();\nif (proc.ExitCode != 0)\n    throw new InvalidOperationException($\"plugin dump failed (exit {proc.ExitCode}).\");","typeGuard":null,"tryCatchPattern":"// Lint runner: capture exit-code failures with their stderr.\ntry { LintPlugin(plugin, fixture); }\ncatch (CliException e) when (e.Code == \"plugin_failed\") {\n    ReportPluginDefect($\"{plugin}: {e.Message}\");\n}","preventionTips":["Always smoke-test '<plugin> dump <fixture>' with an exit-code check before lint.","Use a fixture the plugin is known to support.","Capture and surface plugin stderr to diagnose non-zero exits."],"tags":["plugins","lint","exit-code","plugin-failed"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}