NationalSecurityAgency/ghidra · error · LSHException

Could not drop index: {}

Error message

Could not drop index: {}

What it means

Thrown in dropIndex when ResponseAdjustIndex response is null, i.e. the server rejected the AdjustVectorIndex (doRebuild=false) command. BulkSignatures surfaces the server's BSimError message as an LSHException 'Could not drop index: <message>'. A non-null but unsuccessful response (e.g. operation not supported) is handled as a logged error, not thrown.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java:600

		}
	}

	/**
	 * Drops the current BSim database index which can allow for faster signature ingest after
	 * which a {@link #rebuildIndex()} may be performed.  Dropping the index may also be done to
	 * obtain more accurate results albeit at the cost of performance.
	 * 
	 * @throws IOException if there's an error establishing the database connection
	 * @throws LSHException if there's an error issuing the query
	 */
	public void dropIndex() throws IOException, LSHException {
		DatabaseInformation info = establishQueryServerConnection(false);
		AdjustVectorIndex query = new AdjustVectorIndex();
		query.doRebuild = false;
		ResponseAdjustIndex response = query.execute(querydb);
		if (response == null) {
			BSimError lastError = querydb.getLastError();
			throw new LSHException("Could not drop index: " + lastError.message);
		}
		String dbDetail = "for database " + info.databasename + " (" + bsimServerInfo + ")";
		if (!response.success) {
			String msg = "Could not drop the index " + dbDetail;
			if (!response.operationSupported) {
				msg += ": operation not supported";
			}
			Msg.error(this, msg);
		}
		else {
			Msg.info(this, "Successfully dropped index " + dbDetail);
		}
	}

	/**
	 * Rebuilds the current BSim database index.
	 * 
	 * @throws IOException if there's an error establishing the database connection

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Read the message to learn the server's reason.
  2. Confirm an index exists before dropping (rebuildIndex/dropIndex only make sense after population).
  3. Retry on transient failures; report persistent unsupported/protocol errors.
  4. Ensure privileges allow index operations.

Example fix

// before
bsim.dropIndex();  // no index / unsupported -> LSHException

// after
// only drop after the DB is populated and an index exists; otherwise skip
Defensive patterns

Strategy: try-catch

Validate before calling

// only drop when an index is known to exist on a populated, supported DB

Try / catch

try {
    bsim.dropIndex();
} catch (LSHException e) {
    // message: "Could not drop index: <server>"; if unsupported or none exists, log and continue
}

Prevention

When it happens

Trigger: Calling dropIndex on a database with no index to drop, a backend that does not support index operations, or during a connection/protocol failure that yields a null response.

Common situations: Dropping an index that was never built; backend (e.g. certain H2 configs) lacks vector-index support; transient server error; insufficient privileges.

Related errors


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