NationalSecurityAgency/ghidra · error · ElasticException
Error querying vectorid: ${vectorid}
Error message
Error querying vectorid: ${vectorid} What it means
In the similarity-query path, queryVectorIdMatch for a vector returns null (not an empty array), interpreted as a query-level error rather than 'no matches'. It throws ElasticException("Error querying vectorid: <id>").
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:3308
while (iter1.hasNext()) {
fetchVectors(iter1, iter2, 50); // Fetch vector associated with each vectorid
}
iter1 = vectorList.iterator();
iter2 = vectorList.iterator();
while (iter1.hasNext()) {
fetchVectorCounts(iter1, iter2, MAX_VECTORCOUNT_WINDOW); // Fetch hitcount of each vector
}
int count = 0;
DescriptionManager manager = query.matchresponse.manage;
for (VectorResult vecResult : vectorList) {
if (count >= query.max) {
break;
}
SignatureRecord srec = manager.newSignature(vecResult.vec, vecResult.hitcount);
JsonArray descres;
descres = queryVectorIdMatch(vecResult.vectorid, filter, query.max - count);
if (descres == null) {
throw new ElasticException(
"Error querying vectorid: " + Long.toString(vecResult.vectorid));
}
if (descres.size() == 0) {
if (filter != null) {
continue; // Filter may have eliminated all results
}
// Otherwise this is a sign of corruption in the database
throw new ElasticException(
"No functions matching vectorid: " + Long.toString(vecResult.vectorid));
}
count += descres.size();
convertDescriptionRows(null, descres, vecResult, manager, srec);
}
}
/**
* Entry point for the Elasticsearch version of QueryDelete command:
* Delete specific executables from the databaseView on GitHub (pinned to d5f144c24d)
Solutions
- Retry the query once (often transient).
- Check ES cluster health and logs for the failing shard/request.
- Re-ingest the affected executable if a specific vector is permanently broken.
Example fix
// before Response resp = db.query(req); // surfaces opaque 'Error querying vectorid' // after Response resp = retryOn(() -> db.query(req), 3, ElasticException.class);
Defensive patterns
Strategy: retry
Validate before calling
// Skip the query if the cluster is unhealthy.
if (!clusterHealthy()) throw new ServiceUnavailableException("Cluster unhealthy"); Try / catch
// Retry transient query failures a bounded number of times.
for (int i = 0; i < 3; i++) {
try { return db.query(req); }
catch (ElasticException e) {
if (i == 2 || !isTransient(e.getMessage())) throw e;
}
} Prevention
- Keep the ES cluster healthy and resourced for similarity queries.
- Retry with backoff on transient query errors.
When it happens
Trigger: A similarity query where fetching function descriptions for a specific vector id fails to yield a usable response (server error, malformed/empty response envelope).
Common situations: Transient ES errors; partial cluster outage; response-shape change after a server upgrade; overloaded cluster timing out one shard.
Related errors
- {getType()}scripts cannot be used for context [{context.name
- Unknown script name {scriptSource}
- Could not find hits document
- No functions matching vectorid:
- Multi-search for exe records failed
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/e4446baf4276645d.
Report an issue: GitHub.