{"record":{"id":"a0c4c2234cf2c23a","repo":"SonarSource/sonarqube","slug":"e-getmessage-a0c4c2","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"http","errorClass":"ServerException","httpStatus":500,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/SubmitAction.java","lineNumber":114,"sourceCode":"  }\n\n  @Override\n  public void handle(Request wsRequest, Response wsResponse) throws Exception {\n    String projectKey = wsRequest.mandatoryParam(PARAM_PROJECT_KEY);\n    String projectName = abbreviate(defaultIfBlank(wsRequest.param(PARAM_PROJECT_NAME), projectKey), MAX_COMPONENT_NAME_LENGTH);\n\n    Map<String, String> characteristics = parseTaskCharacteristics(wsRequest);\n\n    try (InputStream report = new BufferedInputStream(wsRequest.mandatoryParamAsPart(PARAM_REPORT_DATA).getInputStream())) {\n      CeTask task = reportSubmitter.submit(projectKey, projectName, characteristics, report);\n      Ce.SubmitResponse submitResponse = Ce.SubmitResponse.newBuilder()\n        .setTaskId(task.getUuid())\n        .setProjectId(task.getComponent().get().getUuid())\n        .build();\n      WsUtils.writeProtobuf(submitResponse, wsRequest, wsResponse);\n    } catch (IllegalStateException e) {\n      LOGGER.debug(e.getMessage(), e);\n      throw new ServerException(HTTP_INTERNAL_ERROR, e.getMessage());\n    }\n  }\n\n  private static Map<String, String> parseTaskCharacteristics(Request wsRequest) {\n    Map<String, String> characteristics = new LinkedHashMap<>();\n\n    for (String param : wsRequest.multiParam(PARAM_ANALYSIS_CHARACTERISTIC)) {\n      String[] pair = StringUtils.split(param, \"=\", 2);\n      checkRequest(pair.length == 2, \"Parameter '%s' must be a key-value pair with the format 'key=value'.\", PARAM_ANALYSIS_CHARACTERISTIC);\n      checkRequest(!characteristics.containsKey(pair[0]), \"Key '%s' was provided twice with parameters '%s'\", pair[0], PARAM_ANALYSIS_CHARACTERISTIC);\n      if (CeTaskCharacteristicDto.SUPPORTED_KEYS.contains(pair[0])) {\n        characteristics.put(pair[0], pair[1]);\n      }\n    }\n    return characteristics;\n  }\n\n}","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/SubmitAction.java#L96-L132","documentation":"SubmitAction.handle submits a scanner report and serializes the CeTaskSubmitResponse. Any IllegalStateException raised during submission (e.g. wrapped IO failures from report saving/splitting) is caught, logged at debug, and rethrown as a ServerException with HTTP 500 carrying the original message. Clients see this message as the WS error body.","triggerScenarios":"POST api/ce/submit where the internal pipeline throws IllegalStateException — most commonly the 'Could not save scanner report to temp file', size-check, or split failures caused by disk/temp problems.","commonSituations":"Full temp disk during large report upload; scanner aborting the stream; underlying storage failures surfacing as 500 to the CI job with only the message text (details at debug level).","solutions":["Enable debug logging on the web server to see the root IllegalStateException cause","Free disk space / fix the temp directory used for report uploads, then retry the scan","Retry the CI analysis after resolving storage issues","If persistent, verify sonar.ce.queue settings and database storage for CE task inputs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"long free = Files.getFileStore(tempDir).getUsableSpace(); if (free < reportLength * 2L) freeSpaceBeforeScan();","typeGuard":null,"tryCatchPattern":"try { submit(); } catch (ServerException e) if (e.status == 500) { enableWebDebugLogs(); retryAfterFsCheck(); }","preventionTips":["Enable debug logging to capture root causes behind 500s","Monitor temp-disk usage on the web server","Retry CI scans on transient storage errors"],"tags":["java","sonarqube","web-api","http-500"],"backgroundTag":"http-error-response","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"}