{"record":{"id":"b845ba9d074d1e00","repo":"SonarSource/sonarqube","slug":"failed-to-split-report-for-task-uuid","errorCode":null,"errorMessage":"Failed to split report for task ${uuid}","messagePattern":"Failed to split report for task (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":500,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java","lineNumber":308,"sourceCode":"    int position = 0;\n    LOGGER.debug(\"Splitting report file {} of size {}\", bigFile.toPath(), sourceSize);\n    try (RandomAccessFile sourceFile = new RandomAccessFile(bigFile, \"r\");\n         FileChannel sourceChannel = sourceFile.getChannel()) {\n\n      final long numSplits = sourceSize / reportPartMaxSizeBytes;\n      final long remainingBytes = sourceSize % reportPartMaxSizeBytes;\n      LOGGER.debug(\"Report file {} will be split in {} parts\", bigFile.toPath(), numSplits + (remainingBytes > 0 ? 1 : 0));\n\n      for (; position < numSplits; position++) {\n        //write multipart files.\n        writePartToDb(dbSession, submit, reportPartMaxSizeBytes, position, sourceChannel, reportPartMaxSizeBytes);\n      }\n      if (remainingBytes > 0) {\n        writePartToDb(dbSession, submit, remainingBytes, position, sourceChannel, reportPartMaxSizeBytes);\n        return position + 1;\n      }\n    } catch (IOException e) {\n      throw new IllegalStateException(\"Failed to split report for task \" + submit.getUuid(), e);\n    }\n    return position;\n  }\n\n  private void writePartToDb(DbSession dbSession, CeTaskSubmit.Builder submit, long byteSize, long partIndex, FileChannel sourceChannel, long reportPartMaxSizeBytes)\n    throws IOException {\n    File file = tempFolder.newFile();\n    try {\n      writePart(byteSize, partIndex, sourceChannel, reportPartMaxSizeBytes, file);\n\n      saveFileOnDb(dbSession, submit, partIndex, file);\n    } finally {\n      deleteTempFile(file);\n    }\n  }\n\n  private static void writePart(long byteSize, long partIndex, FileChannel sourceChannel, long reportPartMaxSizeBytes, File file) throws IOException {\n    try (RandomAccessFile toFile = new RandomAccessFile(file, \"rw\");","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java#L290-L326","documentation":"ReportSubmitter.splitFile chops the report temp file into chunks of reportPartMaxSizeBytes and writes each part to the database through a FileChannel. Any IOException during reading/writing parts is wrapped in this IllegalStateException including the CE task uuid. It means the report could not be sliced for Compute Engine processing.","triggerScenarios":"IOException while reading the source channel (disk error, truncated temp file) or while writing parts inside writePartToDb during the split loop of a large report.","commonSituations":"Reports larger than configured max size hitting storage failures; disk full mid-split; temp file corrupted; DB connection dropped mid-part-write surfacing as IO failure in the split path.","solutions":["Verify free disk space and temp-file integrity during large report uploads","Check CE and web server logs for the wrapped IOException cause","Increase/adjust sonar.ce.task report size settings if parts are exceeding limits","Retry the analysis; if DB-related, verify database connectivity and ce_task_input table health"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (Files.size(tempFile) > maxReportSize) splitOrTrimBeforeSubmit();","typeGuard":null,"tryCatchPattern":"try { submit(); } catch (ServerException e) if (e.status == 500 && e.message.startsWith(\"Failed to split report\")) { retryWithBackoff(); }","preventionTips":["Keep report sizes within configured limits","Monitor disk and DB health for CE nodes","Retry transient storage failures with backoff"],"tags":["java","sonarqube","io","compute-engine"],"backgroundTag":"file-read-failed","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}