NationalSecurityAgency/ghidra · error · QueryDatabaseException
Database does not exist
Error message
Database does not exist
What it means
BSimServerCache.initialize() calls database.initialize() and if it returns false, checks the error category. If the category is ErrorCategory.Nodatabase, the error message is overridden to 'Database does not exist' before throwing QueryDatabaseException. This means the server was reachable but the named database/repository does not exist on it.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/search/dialog/BSimServerCache.java:61
return databaseInfo;
}
/**
* Get cached {@link LSHVectorFactory} for the active BSim Function Database
* @return vector factory or null if DB server not set or never connected
*/
public LSHVectorFactory getLSHVectorFactory() {
return lshVectorFactory;
}
private void initialize() throws QueryDatabaseException {
try (FunctionDatabase database = serverInfo.getFunctionDatabase(false)) {
if (!database.initialize()) { // error message will be set on failure
String errorMessage = database.getLastError().message;
if (database.getLastError().category == ErrorCategory.Nodatabase) {
errorMessage = "Database does not exist";
}
throw new QueryDatabaseException(errorMessage);
}
databaseInfo = database.getInfo();
lshVectorFactory = database.getLSHVectorFactory();
}
}
}
View on GitHub (pinned to d5f144c24d)
Solutions
- Verify the database name in the BSim URL matches an existing database on the server (list databases via BSim command-line tools).
- Create the database on the server if it doesn't exist (bsimctl or the appropriate BSim administration command).
- Check for typos or case sensitivity in the URL path component.
- Confirm you're connecting to the correct server host/port.
Defensive patterns
Strategy: try-catch
Validate before calling
// Before initializing, check that the database exists on the server
try (FunctionDatabase db = serverInfo.getFunctionDatabase(false)) {
if (!db.initialize()) {
if (db.getLastError().category == ErrorCategory.Nodatabase) {
// prompt: create the database first, or fix the URL
}
}
} Try / catch
try {
bsimServerCache.getSomething();
} catch (QueryDatabaseException e) {
if ("Database does not exist".equals(e.getMessage())) {
// guide user to create the database or correct the URL
} else {
throw e;
}
} Prevention
- Validate the database name exists on the BSim server before adding it to the cache.
- Provide a 'test connection' step in the BSim connection UI that reports Nodatabase clearly.
- Create databases via bsimctl before referencing them in the client.
- Check for case-sensitivity in database names when configuring URLs.
When it happens
Trigger: Calling initialize() (triggered lazily when the cache is first accessed) where serverInfo.getFunctionDatabase(false).initialize() returns false and getLastError().category == ErrorCategory.Nodatabase. The server connection succeeded but the database name in the URL doesn't resolve to an actual database.
Common situations: The BSim URL points to a server that is up but the database name/path in the URL doesn't exist (typo, wrong repo name); the database was never created on the server; the database was dropped; connecting to the wrong server instance; case mismatch in the database name.
Related errors
- Password entry was cancelled
- Could not create database:
- Optional table: column type mismatch
- Could not resolve filter specifying executable:
- Could not resolve filter specifying function: [
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/adb2183908ccd0e0.
Report an issue: GitHub.