{"record":{"id":"cd86665c4e53f6db","repo":"NationalSecurityAgency/ghidra","slug":"no-functions-matching-vectorid-vectorid","errorCode":null,"errorMessage":"No functions matching vectorid: ${vectorid}","messagePattern":"No functions matching vectorid: (.+?)","errorType":"exception","errorClass":"ElasticException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java","lineNumber":3316,"sourceCode":"\t\tint count = 0;\n\t\tDescriptionManager manager = query.matchresponse.manage;\n\t\tfor (VectorResult vecResult : vectorList) {\n\t\t\tif (count >= query.max) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSignatureRecord srec = manager.newSignature(vecResult.vec, vecResult.hitcount);\n\t\t\tJsonArray descres;\n\t\t\tdescres = queryVectorIdMatch(vecResult.vectorid, filter, query.max - count);\n\t\t\tif (descres == null) {\n\t\t\t\tthrow new ElasticException(\n\t\t\t\t\t\"Error querying vectorid: \" + Long.toString(vecResult.vectorid));\n\t\t\t}\n\t\t\tif (descres.size() == 0) {\n\t\t\t\tif (filter != null) {\n\t\t\t\t\tcontinue; // Filter may have eliminated all results\n\t\t\t\t}\n\t\t\t\t// Otherwise this is a sign of corruption in the database\n\t\t\t\tthrow new ElasticException(\n\t\t\t\t\t\"No functions matching vectorid: \" + Long.toString(vecResult.vectorid));\n\t\t\t}\n\t\t\tcount += descres.size();\n\t\t\tconvertDescriptionRows(null, descres, vecResult, manager, srec);\n\t\t}\n\t}\n\n\t/**\n\t * Entry point for the Elasticsearch version of QueryDelete command:\n\t *   Delete specific executables from the database\n\t * @param query is command parameters\n\t * @throws ElasticException for communication problems with the server\n\t * @throws LSHException for problems building records\n\t */\n\tprivate void fdbDelete(QueryDelete query) throws ElasticException, LSHException {\n\t\tfinal ResponseDelete response = query.respdelete;\n\t\tfor (ExeSpecifier spec : query.exelist) {\n\t\t\tDescriptionManager manager = new DescriptionManager();","sourceCodeStart":3298,"sourceCodeEnd":3334,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java#L3298-L3334","documentation":"queryVectorIdMatch returned a non-null but empty result for a vector known to exist (the vector document is present), with NO active filter. An empty result without a filter is treated as database corruption -- the vector exists but no function-description documents reference its id (orphaned vector). It throws ElasticException(\"No functions matching vectorid: <id>\").","triggerScenarios":"A vector record exists in the 'vector' index but no function-description documents reference that id, and the query has no filter that could legitimately exclude them.","commonSituations":"Interrupted ingest/delete leaving an orphaned vector; manual index edits; a partial deletion that removed function docs but left the vector.","solutions":["Re-ingest the affected executable(s) to restore function-description linkage.","Run database maintenance / recreate the database if orphans are widespread.","Confirm no filter is set when one was not intended."],"exampleFix":"// before\n// orphaned vector -> query throws 'No functions matching vectorid'\n// after\ndb.dropExecutable(orphanMd5);\ndb.insert(reingestRequest); // restores consistent vector <-> function docs","handlingStrategy":"fallback","validationCode":"// Cannot fully pre-validate corruption, but you can detect orphans via a periodic sweep.\nif (hasOrphanedVectors(db)) scheduleRebuild();","typeGuard":null,"tryCatchPattern":"// Treat as recoverable: log the vector id and re-ingest the owning executable.\ntry { return db.query(req); }\ncatch (ElasticException e) {\n    if (e.getMessage().startsWith(\"No functions matching vectorid\")) {\n        scheduleReingestForVector(extractVectorId(e));\n        return db.query(req);\n    }\n    throw e;\n}","preventionTips":["Avoid interrupting ingest/delete mid-flight; let batches complete.","Periodically reconcile vector vs function-document counts."],"tags":["bsim","corruption","elasticsearch","query"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}