{"record":{"id":"25c79ea2f972f0b0","repo":"NationalSecurityAgency/ghidra","slug":"ec-bad-request","errorCode":"EC_BAD_REQUEST","errorMessage":"Unrecognized request: {}","messagePattern":"Unrecognized request: (.+?)","errorType":"exception","errorClass":"IsfErrorException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-isf/src/main/java/ghidra/dbg/isf/IsfClientHandler.java","lineNumber":94,"sourceCode":"\n\tprotected RootMessage processMessage(Isf.RootMessage msg) throws IOException {\n\t\tswitch (msg.getMsgCase()) {\n\t\t\tcase PING_REQUEST:\n\t\t\t\treturn processPing(msg.getSequence(), msg.getPingRequest());\n\t\t\tcase FULL_EXPORT_REQUEST:\n\t\t\t\treturn processFullExport(msg.getSequence(), msg.getFullExportRequest());\n\t\t\tcase LOOK_TYPE_REQUEST:\n\t\t\t\treturn processLookType(msg.getSequence(), msg.getLookTypeRequest());\n\t\t\tcase LOOK_SYMBOL_REQUEST:\n\t\t\t\treturn processLookSym(msg.getSequence(), msg.getLookSymbolRequest());\n\t\t\tcase LOOK_ADDRESS_REQUEST:\n\t\t\t\treturn processLookAddr(msg.getSequence(), msg.getLookAddressRequest());\n\t\t\tcase ENUM_TYPES_REQUEST:\n\t\t\t\treturn processEnumTypes(msg.getSequence(), msg.getEnumTypesRequest());\n\t\t\tcase ENUM_SYMBOLS_REQUEST:\n\t\t\t\treturn processEnumSyms(msg.getSequence(), msg.getEnumSymbolsRequest());\n\t\t\tdefault:\n\t\t\t\tthrow new IsfErrorException(Isf.ErrorCode.EC_BAD_REQUEST,\n\t\t\t\t\t\"Unrecognized request: \" + msg.getMsgCase());\n\t\t}\n\t}\n\n\tprotected RootMessage processPing(int seqno, Isf.PingRequest req) {\n\t\treturn Isf.RootMessage.newBuilder()\n\t\t\t\t.setSequence(seqno)\n\t\t\t\t.setPingReply(Isf.PingReply.newBuilder().setContent(req.getContent()))\n\t\t\t\t.build();\n\t}\n\n\tprotected RootMessage processFullExport(int seqno, Isf.FullExportRequest req)\n\t\t\tthrows IOException {\n\t\tString data = fullExport(req.getNs());\n\t\treturn Isf.RootMessage.newBuilder()\n\t\t\t\t.setSequence(seqno)\n\t\t\t\t.setFullExportReply(Isf.FullExportReply.newBuilder()\n\t\t\t\t\t\t.setValue(data))","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-isf/src/main/java/ghidra/dbg/isf/IsfClientHandler.java#L76-L112","documentation":"IsfErrorException (a RuntimeException) with error code Isf.ErrorCode.EC_BAD_REQUEST thrown by IsfClientHandler when a dispatched message's case (msg.getMsgCase()) matches none of the handled cases (PING, FULL_EXPORT, LOOK_TYPE/SYMBOL/ADDRESS, ENUM_TYPES/SYMBOLS). The default branch formats the unhandled case into the message. It signals an unrecognized or unset protobuf message case.","triggerScenarios":"An ISF client sends a RootMessage whose msgCase is not one of the handled request types, or whose request oneof field is not set (getMsgCase returns NOT_SET or an unknown enum value after a version skew). The switch in dispatch hits default.","commonSituations":"Client and server built from different versions of the ISF protobuf schema (client sends a newer request type the server does not know); a malformed/empty RootMessage with no request set; a client bug sending the wrong message type for the operation.","solutions":["Align the client and server to the same ISF protobuf schema version so every sent case is handled by the server switch.","Ensure the request oneof is actually set on outgoing RootMessages (avoid dispatching NOT_SET).","Catch IsfErrorException and inspect getErrorCode()/message to map EC_BAD_REQUEST to a client-side retry or schema upgrade.","If adding a new request type, add its case to the server dispatch switch before shipping clients that emit it."],"exampleFix":"// before\nRootMessage msg = RootMessage.newBuilder().setSequence(seq).build(); // no request set\nclient.send(msg);\n\n// after\nRootMessage msg = RootMessage.newBuilder()\n    .setSequence(seq)\n    .setPingRequest(Isf.PingRequest.newBuilder().setContent(\"hi\"))\n    .build();\nclient.send(msg);","handlingStrategy":"validation","validationCode":"Isf.RootMessage.MsgCase c = msg.getMsgCase();\nif (c == Isf.RootMessage.MsgCase.NOT_SET || !HANDLED_CASES.contains(c)) {\n    // do not dispatch; reject at the client before sending\n}","typeGuard":null,"tryCatchPattern":"try {\n    handler.dispatch(msg);\n} catch (IsfErrorException e) {\n    if (e.getErrorCode() == Isf.ErrorCode.EC_BAD_REQUEST) {\n        // unrecognized case; check client/server schema version alignment\n    }\n}","preventionTips":["Keep client and server on the same ISF protobuf schema version.","Always set a recognized request oneof on outgoing RootMessages.","Add new cases to the server switch before shipping clients that emit them."],"tags":["ghidra","isf","protobuf","protocol","bad-request","version-skew"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}