SonarSource/sonarqube · warning · IllegalStateException
Failed to write the GitHub App Manifest response
Error message
Failed to write the GitHub App Manifest response
What it means
IllegalStateException from CreateGithubFromManifestAction.writeJson: the JSON response of the GitHub App manifest exchange could not be written to the HTTP response stream (IOException). This is an infrastructure-level failure after the manifest config code was already retrieved.
Solutions
- Retry the GitHub App manifest creation from the start
- Check proxy/load-balancer timeout settings on the callback path
- Inspect server logs for the wrapped IOException to find the root cause
Example fix
// before
// no retry on write failure
writeJson(response, json);
// after
try {
writeJson(response, json);
} catch (IllegalStateException e) {
logger.warn("Client likely disconnected during manifest callback", e);
} Defensive patterns
Strategy: try-catch
Validate before calling
null
Type guard
null
Try / catch
try {
const resp = await ws.post('api/alm_settings/create_github_from_manifest', params);
} catch (e) {
if (e instanceof IllegalStateException && /Failed to write the GitHub App Manifest response/.test(e.message)) {
logger.warn('Client disconnected during manifest callback; retry the flow', e);
} else { throw e; }
} Prevention
- Keep proxy/client timeouts long enough for the manifest handshake
- Avoid closing the browser during the GitHub App redirect-back
- Retry the whole manifest flow on this error; it is safe to re-run
When it happens
Trigger: api/alm_settings/create_github_from_manifest processing completes but response.output().write() throws IOException — typically client disconnect, container connection abort, or full buffers.
Common situations: User closes the browser during the GitHub App redirect-back handshake; reverse proxy drops the connection; server resource exhaustion.
Related errors
- Failed to redirect to
- Ad-hoc rules export failed after processing
- Can not write to file
- Configuration is not complete
- Could not check the size of the report temp file
AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09).
Data as JSON: /api/errors/7f0121179e7787b6.
Report an issue: GitHub.
Appendix: source
Thrown at server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/CreateGithubFromManifestAction.java:193
* configurable.
*/
private static Set<String> resolveAllowedOrganizations(Request request, @Nullable String organization) {
String rawValue = request.param(PARAM_ALLOWED_ORGANIZATIONS);
if (rawValue != null) {
return Arrays.stream(rawValue.split(","))
.map(String::trim)
.filter(value -> !value.isEmpty())
.collect(toCollection(LinkedHashSet::new));
}
return isBlank(organization) ? Set.of() : Set.of(organization);
}
private static void writeJson(Response response, String json) {
response.stream().setMediaType(MediaTypes.JSON);
try {
response.stream().output().write(json.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new IllegalStateException("Failed to write the GitHub App Manifest response", e);
}
}
}
View on GitHub (pinned to 184c821202)