{"record":{"id":"3f78d7dfc085cb90","repo":"NationalSecurityAgency/ghidra","slug":"error-sending-request-message","errorCode":null,"errorMessage":"Error sending request: {message}","messagePattern":"Error sending request: (.+?)","errorType":"exception","errorClass":"ElasticException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticConnection.java","lineNumber":209,"sourceCode":"\t\t\tconnection = (HttpURLConnection) httpURL.openConnection();\n\t\t\tconnection.setRequestMethod(command);\n\t\t\tconnection.setRequestProperty(\"Content-Type\", \"application/json\");\n\t\t\tconnection.setDoOutput(true);\n\t\t\ttry (Writer writer = new OutputStreamWriter(connection.getOutputStream())) {\n\t\t\t\twriter.write(body);\n\t\t\t}\n\t\t\tlastResponseCode = connection.getResponseCode();\n\t\t\tJsonObject resp = grabResponse(connection);\n\t\t\tif (!lastRequestSuccessful()) {\n\t\t\t\tthrow new ElasticException(parseErrorJSON(resp));\n\t\t\t}\n\t\t\treturn resp;\n\t\t}\n\t\tcatch (URISyntaxException e) {\n\t\t\tthrow new ElasticException(\"Error parsing URL: \" + e.getMessage());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new ElasticException(\"Error sending request: \" + e.getMessage());\n\t\t}\n\t\tcatch (JsonParseException e) {\n\t\t\tthrow new ElasticException(\"Error parsing response: \" + e.getMessage());\n\t\t}\n\t\tfinally {\n\t\t\tif (connection != null) {\n\t\t\t\tconnection.disconnect();\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Execute an elasticsearch command where we are not expecting a response\n\t * @param command is the type of the command\n\t * @param path is the overarching {@code index/type/<command>}\n\t * @param body is the JSON document describing the request\n\t * @throws ElasticException for any problems with the connecting","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticConnection.java#L191-L227","documentation":"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.","triggerScenarios":"executeRawStatement where openConnection(), getOutputStream()/write, or getResponseCode/getInputStream throws IOException. Triggers: ES host unreachable, connection refused, socket timeout, TLS handshake failure, remote reset.","commonSituations":"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.","solutions":["Confirm the Elasticsearch host and port are correct and the service is running.","Test connectivity (telnet/curl) from the Ghidra host to the ES endpoint.","Check firewall/security-group rules and TLS configuration.","If transient, retry; if persistent, inspect the wrapped IOException message for the root cause."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"IOException last;\nfor (int attempt = 0; attempt < 3; attempt++) {\n    try { return conn.executeRawStatement(command, path, body); }\n    catch (ElasticException e) {\n        if (!(e.getCause() instanceof IOException)) throw e;\n        last = (IOException) e.getCause();\n    }\n}\nthrow new ElasticException(\"ES unreachable after retries\", last);","preventionTips":["Verify ES host/port and service availability before issuing requests.","Test connectivity from the Ghidra host to the ES endpoint.","Resolve firewall/TLS/DNS issues before relying on retries."],"tags":["bsim","elastic","network","io","connection","java"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}