{"record":{"id":"0b787053ba1de0da","repo":"iOfficeAI/OfficeCLI","slug":"plugin-failed-0b7870","errorCode":"plugin_failed","errorMessage":"Exporter plugin '{plugin.Manifest.Name}' failed (exit {result.ExitCode}): {Truncate(result.Stderr, 500)}","messagePattern":"Exporter plugin '(.+?)' failed \\(exit (.+?)\\): (.+?)","errorType":"exception","errorClass":"CliException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Plugins/ExporterInvoker.cs","lineNumber":65,"sourceCode":"        var idle = plugin.Manifest.ResolveIdleTimeout(\"export\");\n        var result = PluginProcess.Run(new PluginProcess.RunOptions\n        {\n            ExecutablePath = plugin.ExecutablePath,\n            Arguments = new[] { \"export\", sourceFullPath, \"--out\", outPath },\n            IdleTimeoutSeconds = idle,\n        });\n\n        if (result.IdleTimedOut)\n            throw new CliException(\n                $\"Exporter plugin '{plugin.Manifest.Name}' produced no output for {idle}s — likely hung.\")\n            {\n                Code = \"plugin_idle_timeout\",\n                Suggestion = \"Override with --timeout 0 or raise `idle_timeout_seconds.verbs.export` in the plugin's manifest. \" +\n                             \"Long-running exporters should also emit `{\\\"heartbeat\\\":true}` on stderr periodically.\",\n            };\n\n        if (result.ExitCode != 0)\n            throw new CliException(\n                $\"Exporter plugin '{plugin.Manifest.Name}' failed (exit {result.ExitCode}): {Truncate(result.Stderr, 500)}\")\n            {\n                Code = result.ExitCode switch\n                {\n                    2 => \"corrupt_input\",\n                    3 => \"unsupported_feature\",\n                    4 => \"license_expired\",\n                    5 => \"protocol_mismatch\",\n                    6 => \"plugin_idle_timeout\",\n                    _ => \"plugin_failed\",\n                },\n            };\n\n        if (!File.Exists(outPath))\n            throw new CliException(\n                $\"Exporter plugin '{plugin.Manifest.Name}' reported success but no output file was written at {outPath}.\")\n            { Code = \"plugin_contract_violation\" };\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Plugins/ExporterInvoker.cs#L47-L83","documentation":"CliException thrown when the exporter exits non-zero. Exit-code mapping mirrors the dump-reader: 2=corrupt_input, 3=unsupported_feature, 4=license_expired, 5=protocol_mismatch, 6=plugin_idle_timeout, else plugin_failed. Stderr is truncated to 500 chars.","triggerScenarios":"Exporter process returns non-zero after PluginProcess.Run completes (idle-timeout is checked first).","commonSituations":"Corrupt/locked source (2); exporter cannot handle a feature in the file (3); expired exporter license (4); host/exporter protocol skew (5).","solutions":["Read the mapped code and stderr snippet in the message.","For corrupt_input (2): ensure the source opens in its native app and is not locked by a resident.","For license_expired (4): renew the exporter's license.","For unsupported_feature (3)/protocol_mismatch (5): upgrade the exporter to match the host."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ExporterInvoker.Run(source, targetExt, outPath); }\ncatch (CliException ex) when (ex.Code is \"corrupt_input\" or \"unsupported_feature\" or \"license_expired\" or \"protocol_mismatch\" or \"plugin_failed\")\n{ /* branch on ex.Code; release resident locks if corrupt_input */ }","preventionTips":["Branch on ex.Code for user guidance.","Close residents holding the source before export to avoid corrupt_input.","Track exporter license expiry proactively."],"tags":["plugins","exporter","exit-code","cli-exception"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}