{"record":{"id":"b066d59987f42439","repo":"NationalSecurityAgency/ghidra","slug":"unknown-tag-el-getname-b066d5","errorCode":null,"errorMessage":"Unknown tag: {el.getName()}","messagePattern":"Unknown tag: (.+?)","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/protocol/QueryVectorMatch.java","lineNumber":100,"sourceCode":"\t\tparser.start(\"max\");\n\t\tmax = SpecXmlUtils.decodeInt(parser.end().getText());\n\t\twhile (parser.peek().isStart()) {\n\t\t\tXmlElement el = parser.peek();\n\t\t\tif (el.getName().equals(\"categories\")) {\n\t\t\t\tparser.start();\n\t\t\t\tfillinCategories = SpecXmlUtils.decodeBoolean(parser.end().getText());\n\t\t\t}\n\t\t\telse if (el.getName().equals(\"exefilter\")) {\n\t\t\t\tbsimFilter = new BSimFilter();\n\t\t\t\tbsimFilter.restoreXml(parser);\n\t\t\t}\n\t\t\telse if (el.getName().equals(\"id\")) {\n\t\t\t\tparser.start();\n\t\t\t\tlong val = SpecXmlUtils.decodeLong(parser.end().getText());\n\t\t\t\tvectorIds.add(val);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new LSHException(\"Unknown tag: \" + el.getName());\n\t\t\t}\n\n\t\t}\n\t\tparser.end();\n\t}\n\n}\n","sourceCodeStart":82,"sourceCodeEnd":108,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/protocol/QueryVectorMatch.java#L82-L108","documentation":"Thrown by QueryVectorMatch.restoreXml while deserializing a <queryvectormatch> BSim request. After <max>, only <categories>, <exefilter>, and <id> start elements are accepted; anything else raises LSHException. Strict schema validation for the vector-id query protocol.","triggerScenarios":"Calling QueryVectorMatch.restoreXml(parser, vectorFactory) on XML containing a child element other than categories/exefilter/id after <max>. Caused by version mismatch, hand-edited XML, or feeding a QueryNearest-style payload to the vector-match parser.","commonSituations":"BSim client/server version skew. Mixing QueryNearest and QueryVectorMatch XML payloads. Misspelled tag names in hand-authored XML.","solutions":["Align client and server to the same Ghidra/BSim version.","Ensure the payload was produced by QueryVectorMatch.saveXml, not QueryNearest.saveXml.","Pre-scan child tags and reject any outside {categories, exefilter, id}.","Use the QueryVectorMatch object API (set vectorIds, bsimFilter, etc.) and let saveXml generate canonical XML."],"exampleFix":"// before\nQueryVectorMatch q = new QueryVectorMatch();\nq.restoreXml(parser, vectorFactory); // unknown tag\n\n// after\nQueryVectorMatch q = new QueryVectorMatch();\nq.vectorIds.add(0x1234L);\nq.fillinCategories = false;\nStringWriter sw = new StringWriter();\nq.saveXml(sw); // emit canonical XML, then parse it back","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"categories\", \"exefilter\", \"id\");\n// after <max>, walk child starts and confirm names are within `allowed`","typeGuard":"static boolean isKnownQueryVectorMatchChild(String tag) {\n    return Set.of(\"categories\", \"exefilter\", \"id\").contains(tag);\n}","tryCatchPattern":"try {\n    q.restoreXml(parser, vectorFactory);\n} catch (LSHException e) {\n    if (e.getMessage().startsWith(\"Unknown tag:\")) {\n        throw new LSHException(\"Schema/version mismatch: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Use QueryVectorMatch object API + saveXml to produce canonical XML.","Align Ghidra versions across BSim peers.","Validate the tag set when integrating third-party XML."],"tags":["bsim","xml","deserialization","schema-version"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}