{"record":{"id":"b61798ba2e057c4a","repo":"karatelabs/karate","slug":"failed-to-write-html-summary","errorCode":null,"errorMessage":"Failed to write HTML summary: {}","messagePattern":"Failed to write HTML summary: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/output/HtmlReportListener.java","lineNumber":194,"sourceCode":"    }\n\n    @Override\n    public void onSuiteEnd(SuiteResult result) {\n        try {\n            // Ensure resources are copied\n            ensureResourcesCopied();\n\n            // Write summary pages using canonical feature maps\n            List<Map<String, Object>> summaryCards = suite != null ? suite.getSummaryCards() : java.util.Collections.emptyList();\n            HtmlReportWriter.writeSummaryPages(featureMaps, result, outputDir, env, reportAssets, summaryCards);\n\n            // Write timeline page using canonical feature maps\n            HtmlReportWriter.writeTimelineHtml(featureMaps, result, outputDir, env, threadCount, reportAssets);\n\n            logger.debug(\"HTML report written to: {}\", outputDir.resolve(\"karate-summary.html\"));\n\n        } catch (Exception e) {\n            logger.warn(\"Failed to write HTML summary: {}\", e.getMessage());\n        }\n    }\n\n    private synchronized void ensureResourcesCopied() {\n        if (!resourcesCopied) {\n            try {\n                HtmlReportWriter.copyStaticResources(outputDir.resolve(\"res\"));\n                resourcesCopied = true;\n            } catch (Exception e) {\n                logger.warn(\"Failed to copy static resources: {}\", e.getMessage());\n            }\n        }\n    }\n\n}\n","sourceCodeStart":176,"sourceCodeEnd":210,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/output/HtmlReportListener.java#L176-L210","documentation":"WARN log from HtmlReportListener.onSuiteEnd when generating the suite-level HTML summary (including the timeline page) throws an exception. All tests have already run; only the final HTML summary artifacts are missing or incomplete. The exception message is logged and swallowed.","triggerScenarios":"Exception while writing summary/timeline HTML in onSuiteEnd — usually an I/O error writing into outputDir (read-only, deleted, disk full), or an error building the summary/timeline data from feature maps.","commonSituations":"Output directory cleaned up or locked while the suite was running; disk exhaustion at suite end; file-lock contention from the summary page opened in a browser during the run; permission changes mid-run.","solutions":["Check the logged exception message to identify the failed write path.","Re-run report generation after fixing the output directory, or re-run the suite with a writable outputDir.","Free disk space if the volume is full.","Avoid deleting/locking the report directory (browsers, sync tools, CI cleaners) while the suite runs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// suite-end failures don't propagate; verify the summary artifact afterwards\nFile summary = new File(reportDir, \"karate-summary.html\");\nif (!summary.exists()) logger.warn(\"HTML summary missing — check 'Failed to write HTML summary' log\");","preventionTips":["Don't open/delete the summary HTML in a browser or sync tool while the suite is running.","Ensure sufficient disk space before suite end when many features are aggregated.","Treat a missing karate-summary.html after a run as a signal to inspect this warning."],"tags":["html-report","filesystem","summary","timeline"],"backgroundTag":"file-write-failed","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}