NationalSecurityAgency/ghidra · error · ElasticException

No functions matching vectorid: ${vectorid}

Error message

No functions matching vectorid: ${vectorid}

What it means

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>").

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:3316

		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 database
	 * @param query is command parameters
	 * @throws ElasticException for communication problems with the server
	 * @throws LSHException for problems building records
	 */
	private void fdbDelete(QueryDelete query) throws ElasticException, LSHException {
		final ResponseDelete response = query.respdelete;
		for (ExeSpecifier spec : query.exelist) {
			DescriptionManager manager = new DescriptionManager();

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Re-ingest the affected executable(s) to restore function-description linkage.
  2. Run database maintenance / recreate the database if orphans are widespread.
  3. Confirm no filter is set when one was not intended.

Example fix

// before
// orphaned vector -> query throws 'No functions matching vectorid'
// after
db.dropExecutable(orphanMd5);
db.insert(reingestRequest); // restores consistent vector <-> function docs
Defensive patterns

Strategy: fallback

Validate before calling

// Cannot fully pre-validate corruption, but you can detect orphans via a periodic sweep.
if (hasOrphanedVectors(db)) scheduleRebuild();

Try / catch

// Treat as recoverable: log the vector id and re-ingest the owning executable.
try { return db.query(req); }
catch (ElasticException e) {
    if (e.getMessage().startsWith("No functions matching vectorid")) {
        scheduleReingestForVector(extractVectorId(e));
        return db.query(req);
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Interrupted ingest/delete leaving an orphaned vector; manual index edits; a partial deletion that removed function docs but left the vector.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/cd86665c4e53f6db. Report an issue: GitHub.