NationalSecurityAgency/ghidra · error · ElasticException

Error sending request: {message}

Error message

Error sending request: {message}

What it means

Thrown by ElasticConnection.executeRawStatement when an IOException occurs during the HTTP exchange (opening the connection, writing the body, reading getResponseCode/getInputStream). The original IOException message is wrapped. This covers transport failures: connection refused, reset, timeout, or stream read errors.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticConnection.java:209

			connection = (HttpURLConnection) httpURL.openConnection();
			connection.setRequestMethod(command);
			connection.setRequestProperty("Content-Type", "application/json");
			connection.setDoOutput(true);
			try (Writer writer = new OutputStreamWriter(connection.getOutputStream())) {
				writer.write(body);
			}
			lastResponseCode = connection.getResponseCode();
			JsonObject resp = grabResponse(connection);
			if (!lastRequestSuccessful()) {
				throw new ElasticException(parseErrorJSON(resp));
			}
			return resp;
		}
		catch (URISyntaxException e) {
			throw new ElasticException("Error parsing URL: " + e.getMessage());
		}
		catch (IOException e) {
			throw new ElasticException("Error sending request: " + e.getMessage());
		}
		catch (JsonParseException e) {
			throw new ElasticException("Error parsing response: " + e.getMessage());
		}
		finally {
			if (connection != null) {
				connection.disconnect();
			}
		}

	}

	/**
	 * Execute an elasticsearch command where we are not expecting a response
	 * @param command is the type of the command
	 * @param path is the overarching {@code index/type/<command>}
	 * @param body is the JSON document describing the request
	 * @throws ElasticException for any problems with the connecting

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Confirm the Elasticsearch host and port are correct and the service is running.
  2. Test connectivity (telnet/curl) from the Ghidra host to the ES endpoint.
  3. Check firewall/security-group rules and TLS configuration.
  4. If transient, retry; if persistent, inspect the wrapped IOException message for the root cause.
Defensive patterns

Strategy: retry

Try / catch

IOException last;
for (int attempt = 0; attempt < 3; attempt++) {
    try { return conn.executeRawStatement(command, path, body); }
    catch (ElasticException e) {
        if (!(e.getCause() instanceof IOException)) throw e;
        last = (IOException) e.getCause();
    }
}
throw new ElasticException("ES unreachable after retries", last);

Prevention

When it happens

Trigger: executeRawStatement where openConnection(), getOutputStream()/write, or getResponseCode/getInputStream throws IOException. Triggers: ES host unreachable, connection refused, socket timeout, TLS handshake failure, remote reset.

Common situations: Wrong host/port in hostURL; ES service down; firewall blocking the port; network partition; TLS certificate problems; client-side socket timeout too low; DNS resolution failure.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/3f78d7dfc085cb90. Report an issue: GitHub.