gradle/gradle · warning
${reportFileName.capitalized()} is taking too long to write.
Error message
${reportFileName.capitalized()} is taking too long to write... The build might finish before the report has been completely written. What it means
The configuration-cache / problems HTML report is written asynchronously on a ManagedExecutor. On shutdown the writer waits up to 1 second (awaitTermination); if report tasks have not finished, shutdownNow() cancels the remainder, this warning is logged, and the unfinished task count goes to debug logs. The consequence is a possibly truncated or incomplete report file — the build itself is unaffected.
Source
Thrown at platforms/core-configuration/configuration-problems-base/src/main/kotlin/org/gradle/internal/configuration/problems/CommonReport.kt:200
writer.close()
}
executor.shutdown()
}
return Closed
}
private
fun closeHtmlReport(details: JsonSource) {
writer.endHtmlReport(details)
writer.close()
}
private
fun ManagedExecutor.shutdownAndAwaitTermination() {
shutdown()
if (!awaitTermination(1, TimeUnit.SECONDS)) {
val unfinishedTasks = shutdownNow()
logger.warn(
"${reportFileName.capitalized()} is taking too long to write... "
+ "The build might finish before the report has been completely written."
)
logger.info("Unfinished tasks: {}", unfinishedTasks)
}
}
private
fun moveSpoolFileTo(outputDirectory: File): File {
val reportDir = getReportDirectory(outputDirectory)
val reportFile = reportDir.resolve("$reportFileName.html")
if (distinctReports) {
if (!reportFile.exists()) {
moveFileToOutput(reportDir, reportFile)
}
} else {
moveFileToOutput(reportDir, reportFile)View on GitHub (pinned to 534f27719b)
Solutions
- Re-run the build — usually transient under I/O contention
- Write reports to fast local storage instead of network mounts
- Reduce report volume by fixing reported problems or relaxing org.gradle.warning.mode
- Check debug logs ('Unfinished tasks: N') to see how many tasks were dropped
Defensive patterns
Strategy: fallback
Validate before calling
# after the build, check the report landed intact before archiving test -s build/reports/configuration-cache/report.html \ || echo "configuration cache report incomplete — rerun before archiving"
Prevention
- Keep build and report directories on local fast disks
- Trim warning volume in very large builds
- Do not treat the HTML report as guaranteed available before process exit
When it happens
Trigger: Very large builds producing thousands of configuration-cache/problems entries, slow or contended disks (network filesystems, throttled CI containers), or CPU overload making the 1-second grace period expire before spooled report tasks drain.
Common situations: Huge multi-project builds on CI; report directories on NFS or mounted volumes; builds with extensive problem diagnostics right after enabling stricter warning modes.
Related errors
- Cannot add '%s' to '%s' as it is a filtered collection
- Could not write %s content to %s.
- Could not write %s content to %s.
- Could not write %s content to %s.
- Cannot list files in
AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22).
Data as JSON: /api/errors/3131d927e5fc404c.
Report an issue: GitHub.