NationalSecurityAgency/ghidra · error · SQLException

No functions matching vectorid:

Error message

No functions matching vectorid: 

What it means

A vector exists in the vectors table (returned by nearest-neighbor search) but zero DescriptionRows reference it, and no filter was applied (a filter would have short-circuited with return 0). The code explicitly comments this as 'a sign of corruption in the database' -- an orphaned vector with no function metadata.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java:1380

			throws SQLException, LSHException {
		SignatureRecord srec = res.newSignature(dresult.vec, dresult.hitcount);
		List<DescriptionRow> descres;
		if (filter == null) {
			descres = descTable.queryVectorIdMatch(dresult.vectorid, query.max - count);
		}
		else {
			descres = descTable.queryVectorIdMatchFilter(dresult.vectorid, filter.tableClause(),
				filter.whereClause(), query.max - count);
		}
		if (descres == null) {
			throw new SQLException("Error querying vectorid: " + Long.toString(dresult.vectorid));
		}
		if (descres.size() == 0) {
			if (filter != null) {
				return 0; // Filter may have eliminated all results
			}
			// Otherwise this is a sign of corruption in the database
			throw new SQLException(
				"No functions matching vectorid: " + Long.toString(dresult.vectorid));
		}
		convertDescriptionRows(simres, descres, dresult, res, srec);
		return descres.size();
	}

	/**
	 * 
	 * @param resultset the list of result set objects to populate
	 * @param vec the vector containing the saveSQL query statement
	 * @param simthresh the similarity threshold
	 * @param sigthresh the confidence threshold
	 * @param max the max number of results to return
	 * @return the number of results returned
	 * @throws SQLException if there is a problem creating or executing the query
	 */
	protected abstract int queryNearestVector(List<VectorResult> resultset, LSHVector vec,
			double simthresh, double sigthresh, int max) throws SQLException;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Audit the DB for orphaned vectors (vector rows lacking a descTable entry).
  2. Re-ingest the affected executables to restore consistency.
  3. Run DB integrity checks and consider a rebuild if orphans are widespread.
Defensive patterns

Strategy: validation

Validate before calling

// Periodic integrity audit: flag vectors whose id has no descTable row.
String sql = "SELECT v.id FROM vectors v LEFT JOIN description d ON d.vector_id = v.id " +
    "WHERE d.id IS NULL";
try (Connection c = ds.getConnection();
     Statement s = c.createStatement();
     ResultSet rs = s.executeQuery(sql)) {
    List<Long> orphans = new ArrayList<>();
    while (rs.next()) orphans.add(rs.getLong(1));
    if (!orphans.isEmpty()) log.warn("orphaned vectors: {}", orphans);
}

Try / catch

try {
    return db.queryNearest(query);
} catch (SQLException e) {
    if (e.getMessage().startsWith("No functions matching vectorid:")) {
        // corruption -- trigger maintenance / re-ingest rather than retry
        triggerMaintenance();
        throw new DatabaseCorruptException(e.getMessage(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: A vector row exists but its descTable entries were deleted or never committed (aborted/partial insert left an orphan). The nearest-neighbor search found the vector, but metadata resolution yields nothing.

Common situations: Aborted ingest leaving partial state; manual deletion of function rows without cleaning vectors; DB inconsistency after a crash; transactional boundary violation during ingest.

Related errors


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