NationalSecurityAgency/ghidra · error · IOException

{}

Error message

{}

What it means

Thrown during establishQueryServerConnection when querydb.initialize() returns false. A false return means the underlying FunctionDatabase client could not establish its connection/handshake, so BulkSignatures wraps the client's BSimError message in an IOException and rethrows. The '{}' is the raw server/client error text from querydb.getLastError().message (e.g. authentication, connection refused, initialization failure).

Source

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

	/**
	 *
	 * 
	 * @param async true if database commits should be synchronous
	 * @return  the {@link DatabaseInformation} object returned from a successful connect
	 * @throws IOException if there's a problem creating the connection
	 */
	private DatabaseInformation establishQueryServerConnection(boolean async) throws IOException {

		if (querydb != null) {
			return querydb.getInfo();
		}

		checkBSimServerOperation();

		querydb = BSimClientFactory.buildClient(bsimServerInfo, async);

		if (!querydb.initialize()) {
			throw new IOException(querydb.getLastError().message);
		}

		DatabaseInformation info = querydb.getInfo();
		if (info == null) {
			BSimError lastError = querydb.getLastError();
			if (lastError != null && lastError.category == ErrorCategory.Nodatabase) {
				throw new IOException(lastError.message);
			}
			throw new IOException("Unknown error connection to: " + bsimServerInfo.toString());
		}

		Msg.debug(this, "Connected to " + info.databasename);
		return info;
	}

	/**
	 * This will be automatically invoked when BulkSignatures is out of scope, if using
	 * try-with-resources to create it. When this happens we need to clean up the 

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Check the literal message from the exception to see the underlying category (Connection/Authentication/Initialization).
  2. Verify the BSim server is running and reachable (port open, correct host).
  3. Re-supply/refresh credentials or the auth token if the message indicates authentication.
  4. Confirm client and server run compatible Ghidra versions.

Example fix

// before
BulkSignatures bsim = new BulkSignatures(serverInfo);
bsim.prewarm();  // initialize() failed -> IOException

// after
// first validate connectivity in a controlled block, inspect getLastError, fix URL/creds, then retry
Defensive patterns

Strategy: try-catch

Try / catch

try {
    bsim.prewarm(); // or any server op
} catch (IOException e) {
    // e.getMessage() is querydb.getLastError().message; inspect for Connection/Auth/Init
    log.error("BSim connection init failed: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Any server operation after a bad connect: wrong host/port, TLS/cert mismatch, auth failure during the initialize handshake, incompatible BSim protocol version, or the server being down. initialize() returning false is the precondition.

Common situations: BSim URL points to a stopped or wrong server; PostgreSQL/Elasticsearch backend down; credentials invalid or auth token expired; firewall/proxy blocking the gRPC/HTTP path; client and server built from divergent Ghidra versions speaking different protocols.

Related errors


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