NationalSecurityAgency/ghidra · error · IOException
connection.getResponseMessage()
Error message
connection.getResponseMessage()
What it means
Thrown by ElasticConnection.grabResponse when the HTTP input stream (or error stream) is null, meaning the connection did not yield any response body. It wraps connection.getResponseMessage() in an IOException and is re-thrown to callers as part of executeRawStatement/executeStatementNoResponse IOException handling. This indicates a transport-level failure rather than an Elasticsearch error document.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticConnection.java:94
/**
* Assuming the writer has been closed and connection.getResponseCode() is called
* placing the value in lastResponseCode, read the response and parse into a JsonObject
* @return the JsonObject
* @throws IOException for problems with the socket
* @throws JsonParseException for JSON parse errors
*/
private JsonObject grabResponse(HttpURLConnection connection)
throws IOException, JsonParseException {
InputStream in;
if (lastRequestSuccessful()) {
in = connection.getInputStream();
}
else {
in = connection.getErrorStream();
}
if (in == null) {
// Connection error occurred
throw new IOException(connection.getResponseMessage());
}
Reader reader = new InputStreamReader(in);
JsonObject jsonObject = JsonParser.parseReader(reader).getAsJsonObject();
return jsonObject;
}
/**
* Elastic search sends a JSON document in the Http error stream for any error
* Pull out relevant info from the document and construct an exception message
* @param resp is the parsed error document
* @return the exception String
*/
private static String parseErrorJSON(JsonObject resp) {
Object errorObj = resp.get("error");
if (errorObj instanceof String) {
return (String) errorObj;
}
if (!(errorObj instanceof JsonObject err)) {View on GitHub (pinned to d5f144c24d)
Solutions
- Verify the Elasticsearch host is reachable and healthy (curl the cluster health endpoint).
- Check hostURL/credentials configuration in the BSim database settings.
- Inspect network/proxy/firewall between the Ghidra client and the ES host.
- Retry after confirming the ES process is up and the port is correct.
Defensive patterns
Strategy: retry
Try / catch
try {
return conn.executeRawStatement(cmd, path, body);
} catch (ElasticException e) {
if (e.getCause() instanceof IOException && e.getMessage().contains("getResponseMessage")) {
// retry after confirming server health
} else throw e;
} Prevention
- Keep the Elasticsearch endpoint healthy and reachable.
- Validate hostURL configuration before opening a connection.
- Monitor cluster health to catch downtime before issuing requests.
When it happens
Trigger: grabResponse reads connection.getInputStream() (on success) or connection.getErrorStream() (on failure); if both are null it throws IOException(getResponseMessage()). Reached whenever the HTTP connection is established but no body is returned (e.g. server reset, DNS-level redirect, proxy dropping the body).
Common situations: Elasticsearch server down or restarted mid-request; network/proxy timeout severing the response; misconfigured hostURL pointing at a non-ES service; TLS/firewall reset; the server returned a status with no body.
Related errors
- Error sending request: {message}
- {type} : {reason}
- Error parsing response: {message}
- Unable to connect to server
- Bad base64 encoding
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/012e6f11661705e2.
Report an issue: GitHub.