{"record":{"id":"c39f4bcc085d37d4","repo":"NationalSecurityAgency/ghidra","slug":"could-not-respond-during-negotiation","errorCode":null,"errorMessage":"Could not respond during negotiation","messagePattern":"Could not respond during negotiation","errorType":"exception","errorClass":"TraceRmiError","httpStatus":null,"severity":"critical","filePath":"Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiHandler.java","lineNumber":523,"sourceCode":"\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tdispose();\n\t\t\t}\n\t\t\tcatch (IOException e) {\n\t\t\t\tMsg.error(this, \"Could not close socket after error\", e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected void negotiate() {\n\t\tRootMessage req = receive();\n\t\tif (req == null) {\n\t\t\tthrow new TraceRmiError(\"Could not receive negotiation request\");\n\t\t}\n\t\tRootMessage rep = dispatchNegotiate.handle(req);\n\t\tif (!send(rep)) {\n\t\t\tthrow new TraceRmiError(\"Could not respond during negotiation\");\n\t\t}\n\t}\n\n\tprivate interface Dispatcher {\n\t\tRootMessage.Builder dispatch(RootMessage req, RootMessage.Builder rep) throws Exception;\n\n\t\tdefault String exceptionMessage(Throwable exc) {\n\t\t\tString msg = exc.getMessage();\n\t\t\tif (msg == null) {\n\t\t\t\treturn exc.getClass().getCanonicalName();\n\t\t\t}\n\t\t\treturn exc.getClass().getCanonicalName() + \": \" + msg;\n\t\t}\n\n\t\tdefault RootMessage handle(RootMessage req) {\n\t\t\tString desc = toString(req);\n\t\t\tif (desc != null) {\n\t\t\t\tTimedMsg.debug(this, \"HANDLING: \" + desc);","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiHandler.java#L505-L541","documentation":"Thrown during TraceRmiHandler.negotiate() after the request was received and a reply built, but send(rep) returns false, meaning the response could not be written back to the peer. The handshake is therefore incomplete and the connection is unusable.","triggerScenarios":"The peer closed its side of the socket between sending the negotiation request and reading the reply; an IOException occurred while writing the reply; the output stream is broken.","commonSituations":"Peer timed out waiting and disconnected; network glitch mid-handshake; peer crashed right after sending its request; socket write buffer closed.","solutions":["Increase the peer's handshake timeout so it waits for the reply.","Verify network stability between frontend and backend for transient drops.","Check the peer did not crash between request and reply (peer logs).","Re-establish the connection from scratch."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    handler.run();\n} catch (TraceRmiError e) {\n    // reply could not be sent; peer likely disconnected; reconnect\n}","preventionTips":["Ensure the peer waits long enough to read the negotiation reply.","Check peer logs for a crash between request and reply.","Re-establish the connection rather than reuse the broken socket."],"tags":["trace-rmi","negotiation","connection","network"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}