{"record":{"id":"7e5ec9f07d1a34fa","repo":"JuliusBrussee/caveman","slug":"cache-replay-failed-to-finalize-failure-manifest","errorCode":null,"errorMessage":"cache-replay: failed to finalize failure manifest: %w","messagePattern":"cache-replay: failed to finalize failure manifest: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cache-replay/main.go","lineNumber":326,"sourceCode":"\t\tif summaryErr != nil {\n\t\t\tfatalRuntime(summaryErr)\n\t\t}\n\t\tmanifest.ReplaySummary = &summary\n\t\tif err := writeJSON(filepath.Join(*outputPath, \"replay-summary.json\"), summary); err != nil {\n\t\t\tfatalRuntime(err)\n\t\t}\n\t}\n\tif runErr != nil {\n\t\tmanifest.Status = \"failed\"\n\t\tvar replayFailure *cachebench.ReplayRunError\n\t\tif errors.As(runErr, &replayFailure) {\n\t\t\tmanifest.FailedRequest, manifest.FailureCode = replayFailure.RequestID, replayFailure.FailureCode\n\t\t} else if len(sink.evidence) > 0 {\n\t\t\tlast := sink.evidence[len(sink.evidence)-1]\n\t\t\tmanifest.FailedRequest, manifest.FailureCode = last.RequestID, last.FailureCode\n\t\t}\n\t\tif err := writeJSON(filepath.Join(*outputPath, \"manifest.json\"), manifest); err != nil {\n\t\t\tfatalRuntime(fmt.Errorf(\"cache-replay: failed to finalize failure manifest: %w\", err))\n\t\t}\n\t\tfatalRuntime(runErr)\n\t}\n\treport, err := cachebench.EvaluateObservedAgainstTrace(sink.observations, records, target)\n\tif err != nil {\n\t\tfatalRuntime(err)\n\t}\n\tif err := writeJSON(filepath.Join(*outputPath, \"report.json\"), report); err != nil {\n\t\tfatalRuntime(err)\n\t}\n\tmanifest.Status = report.Status\n\tif err := writeJSON(filepath.Join(*outputPath, \"manifest.json\"), manifest); err != nil {\n\t\tfatalRuntime(err)\n\t}\n\twriteStdout(map[string]any{\"manifest\": manifest, \"report\": report.Overall})\n\tif !report.Overall.GatePassed {\n\t\tos.Exit(1)\n\t}","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cmd/cache-replay/main.go#L308-L344","documentation":"Raised at the end of a failed cache-replay run while writing the failure manifest: after recording status=failed, the manifest finalization (writing failure-manifest.json) itself errored. The run already failed; this error means the evidence artifact for the failure could not be persisted.","triggerScenarios":"Thrown at cacheengine/cmd/cache-replay/main.go:326 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error: common causes are a full disk or the output directory being removed mid-run","Re-run with a fresh output directory on writable storage","Inspect any partially written manifest to salvage what evidence exists"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}