NationalSecurityAgency/ghidra · error · NoDatabaseException
NoDatabaseException: baseURL
Error message
NoDatabaseException: baseURL
What it means
During database initialization the code GETs 'vector/_settings'. If Elasticsearch responds with an error whose message contains 'no such index', the core 'vector' index of the BSim database does not exist on that URL, so NoDatabaseException(baseURL) is thrown: the named database was never created at that server.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:2394
private void initializeElastic(Configuration config)
throws ElasticException, NoDatabaseException {
connection = new ElasticConnection(baseURL, repository);
if (baseURL.startsWith("https")) {
connectionType = ConnectionType.SSL_Password_Authentication;
}
config.info = new DatabaseInformation();
readBasicInfo(config);
vectorFactory = new Base64VectorFactory();
config.weightfactory = new WeightFactory();
config.idflookup = new IDFLookup();
JsonObject res;
try {
res = connection.executeURIOnly(ElasticConnection.GET, "vector/_settings");
}
catch (ElasticException ex) {
if (ex.getMessage().contains("no such index")) {
throw new NoDatabaseException(baseURL);
}
throw ex;
}
JsonObject repo = (JsonObject) res.get(repository + "_vector");
JsonObject settings = (JsonObject) repo.get("settings");
JsonObject index = (JsonObject) settings.get("index");
JsonObject analysis = (JsonObject) index.get("analysis");
JsonObject tokenizer = (JsonObject) analysis.get("tokenizer");
String tokenizerName = null;
for (String key : tokenizer.keySet()) {
if (key.startsWith("lsh_")) {
tokenizerName = key;
break;
}
}
if (tokenizerName == null) {
throw new ElasticException("Missing tokenizer configuration");
}View on GitHub (pinned to d5f144c24d)
Solutions
- Run the BSim create-database workflow for that URL/name first.
- Verify the URL/database name spelling and that it resolves to the intended ES host.
- Point the client at the cluster that actually hosts the index.
Example fix
// before
FunctionDatabase db = FunctionDatabase.getInstance();
db.initialize(url); // throws NoDatabaseException
// after
if (!databaseExistsOnCluster(url)) {
createDatabase(url, template); // first-time setup
}
FunctionDatabase db = FunctionDatabase.getInstance();
db.initialize(url); Defensive patterns
Strategy: validation
Validate before calling
// Check the index exists before opening. boolean exists = esClient.indices().exists(b -> b.index(repo + "_vector")).value(); if (!exists) throw new NoDatabaseException(url);
Type guard
boolean databaseInitialized = esClient.indices().exists(e -> e.index(repo + "_vector")).value();
Try / catch
try {
db.initialize(url);
} catch (NoDatabaseException e) {
// first run: create then retry
createDatabase(url, template); db.initialize(url);
} Prevention
- Run create-database as a documented prerequisite in deploy runbooks.
- Resolve database names centrally to avoid typos.
When it happens
Trigger: Opening/connecting to a BSim Elasticsearch URL whose repository+database was never created (the create-database step was not run, or was run against a different cluster).
Common situations: Wrong bsim:// URL or typo in the database name; server reset/rebuilt; connecting to the wrong ES cluster; create-database step skipped or failed silently.
Related errors
- {getType()}scripts cannot be used for context [{context.name
- Unknown script name {scriptSource}
- Document is missing "features"
- Document does not contain complete "features"
- PostgreSQL pg_ctl command not found: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/1340332d1cc5bea6.
Report an issue: GitHub.