NationalSecurityAgency/ghidra · error · LSHException

{database.getLastError().message}

Error message

{database.getLastError().message}

What it means

Thrown by ExecutableComparison.pullConnectionInfo when a QueryInfo execute() returns a null response, indicating the query failed. The actual failure message is retrieved from database.getLastError().message. This wraps any server-side or protocol-level QueryInfo failure into an LSHException.

Source

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

	 */
	public boolean isConfigured() {
		return (scorer.simThreshold > 0.0);
	}

	/**
	 * Make sure the database has an active connection. Query for basic
	 * information and inform the scorer of settings
	 * @return information from the database
	 * @throws LSHException if something is wrong with the connection
	 */
	private DatabaseInformation pullConnectionInfo() throws LSHException {
		if (!database.initialize()) {
			throw new LSHException("Unable to connect to server");
		}
		QueryInfo query = new QueryInfo();
		ResponseInfo response = query.execute(database);
		if (response == null) {
			throw new LSHException(database.getLastError().message);
		}
		vectorFactory = database.getLSHVectorFactory();
		return response.info;
	}

	/**
	 * Look up a full ExecutableRecord in the database given an md5
	 * @param md5 is the md5 String
	 * @return the corresponding ExecutableRecord
	 * @throws LSHException if there are problems accessing the database
	 *    or the executable doesn't exist
	 */
	private ExecutableRecord lookupExecutable(String md5) throws LSHException {
		QueryName query = new QueryName();
		query.spec = new ExeSpecifier();
		query.spec.exemd5 = md5;
		query.maxfunc = 1;
		query.fillinCallgraph = false;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Inspect db.getLastError().message for the specific underlying cause.
  2. Verify client/server BSim protocol versions are compatible.
  3. Recreate or repair the BSim database if metadata is corrupted.
  4. Retry after resolving the reported server-side error.

Example fix

// before
DatabaseInformation info = cmp.pullConnectionInfo(); // opaque failure
// after (wrap to expose detail)
QueryInfo q = new QueryInfo();
ResponseInfo r = q.execute(database);
if (r == null) {
    throw new RuntimeException("QueryInfo failed: " + database.getLastError().message);
}
Defensive patterns

Strategy: try-catch

Try / catch

catch (LSHException e) { String msg = e.getMessage(); log.error("QueryInfo failed: {}", msg); /* msg == db.getLastError().message; diagnose and surface to user */ }

Prevention

When it happens

Trigger: database.initialize() succeeds but the subsequent QueryInfo (basic database metadata query) fails and returns null — e.g., protocol error, server-side exception, authentication succeeds but query permission fails, or the server returns a malformed response.

Common situations: Connected to a partially-initialized or corrupted BSim database; version mismatch between client and server; permission issues on the database; transient server error during the initial metadata fetch.

Related errors


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