NationalSecurityAgency/ghidra · error · IOException
Unable to drop database: {}
Error message
Unable to drop database: {} What it means
Thrown in BulkSignatures.dropDatabase when ResponseDropDatabase response is null, i.e. the server rejected the DropDatabase command. BulkSignatures wraps the server's BSimError message into 'Unable to drop database: <message>'. Note this covers the protocol-level null response; a non-null but unsuccessful response is handled separately as a logged error rather than a throw.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java:466
boolean success = querydb.initialize();
if (!success) {
Msg.error(this, "Database initialization error: " + querydb.getLastError().message);
}
}
/**
* Drops the current BSim database.
*
* @throws IOException if there's an error establishing the database connection
*/
public void dropDatabase() throws IOException {
establishQueryServerConnection(false); // Set up client configuration
querydb.close(); // Database can't be in use when we try to drop it
DropDatabase command = new DropDatabase();
command.databaseName = bsimServerInfo.getDBName();
ResponseDropDatabase response = command.execute(querydb);
if (response == null) {
throw new IOException("Unable to drop database: " + querydb.getLastError().message);
}
if (response.dropSuccessful) {
Msg.info(this, "Successfully dropped database \"" + command.databaseName + "\"");
}
else {
Msg.error(this, "Unable to drop database: " + response.errorMessage);
}
}
/**
* Adds function signatures from the specified project to the BSim database
* @param ghidraURL ghidra repository from which to pull files for signature generation
* @param sigsLocation the location where signature files will be stored
* @param overwrite if true, overwrites any existing signatures
* @param monitor the task monitor
* @throws Exception if there's an error during the operation
* @throws CancelledException if processing is cancelled
*/View on GitHub (pinned to d5f144c24d)
Solutions
- Read the message to get the server's reason (nonexistent vs. in-use vs. permission).
- Ensure no other client/connection is using the database, then retry.
- Confirm the connecting user has drop privileges on the backend.
- Verify the database name matches an existing one.
Example fix
// before bsim.dropDatabase(); // in-use -> IOException // after // close other connections to the DB, then retry bsim.dropDatabase();
Defensive patterns
Strategy: try-catch
Try / catch
try {
bsim.dropDatabase();
} catch (IOException e) {
String m = e.getMessage();
if (m.contains("does not exist")) { /* already gone; ignore */ }
else if (m.contains("in use") || m.contains("is being used")) {
// close other connections and retry
} else { throw e; }
} Prevention
- Ensure no other client holds the database open before dropping.
- Verify the database name exists before dropping.
- Confirm drop privileges on the backend.
When it happens
Trigger: Calling dropDatabase when the server refuses: database does not exist, the client has no drop permission, the database is in use by another connection, or a backend error.
Common situations: Dropping a name that was never created or already dropped; another active client holds the database open; operator lacks drop privileges.
Related errors
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/fe8e5503977fb4be.
Report an issue: GitHub.