NationalSecurityAgency/ghidra · error · IllegalArgumentException
Invalid {} dbName: {}
Error message
Invalid {} dbName: {} What it means
Thrown by the multi-argument BSimServerInfo constructor when dbType is postgres or elastic and the dbName contains a forward slash ('/') or backslash ('\'). Network database names must be simple identifiers with no path separators; a separator usually indicates the caller mistakenly passed a file path. Throws IllegalArgumentException.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java:100
if ((dbType == DBType.postgres || dbType == DBType.elastic) && StringUtils.isEmpty(host)) {
throw new IllegalArgumentException("host required");
}
dbName = dbName.trim();
if (StringUtils.isEmpty(dbName)) {
throw new IllegalArgumentException("Non-empty dbName required");
}
if (dbType == DBType.file) {
host = null;
port = -1;
userinfo = null;
dbName = cleanupFilename(dbName);
}
else {
if (dbName.contains("/") || dbName.contains("\\")) { // may want additional validation
throw new IllegalArgumentException("Invalid " + dbType + " dbName: " + dbName);
}
userinfo = cleanupUserInfo(userinfo);
if (port <= 0) {
port = -1;
}
if (dbType == DBType.postgres && port <= 0) {
port = DEFAULT_POSTGRES_PORT;
}
if (dbType == DBType.elastic && port <= 0) {
port = DEFAULT_ELASTIC_PORT;
}
}
this.userinfo = userinfo;
this.host = host;
this.port = port;
this.dbName = dbName;
}View on GitHub (pinned to d5f144c24d)
Solutions
- Pass a simple database name (no slashes) for postgres/elastic types.
- If the value is actually a file path, use DBType.file instead.
- Strip or reject path separators from user-supplied dbName input before construction.
Example fix
// before new BSimServerInfo(DBType.postgres, null, "host", 5432, "/var/bsim/data"); // after (simple name for postgres) new BSimServerInfo(DBType.postgres, null, "host", 5432, "bsimdb");
Defensive patterns
Strategy: validation
Validate before calling
if ((type == BSimServerInfo.DBType.postgres || type == BSimServerInfo.DBType.elastic) && (dbName.contains("/") || dbName.contains("\\"))) {
throw new IllegalArgumentException("postgres/elastic dbName must not contain path separators: " + dbName);
} Prevention
- Pass simple identifiers as dbName for network databases.
- If the value looks like a path, route it to DBType.file instead.
- Reject path separators in user input before constructing BSimServerInfo.
When it happens
Trigger: Passing a file-path-style dbName such as '/var/bsim/data' or 'C:\bsim' to the postgres/elastic constructor.
Common situations: Reusing a file-system path as the dbName for a network DB; copy-pasting a datadir path into the dbName field; incorrect DBType chosen (file path passed to a postgres descriptor).
Related errors
- host required
- Non-empty dbName required
- Remote file URL not supported: {}
- Unsupported BSim URL protocol: {}
- Missing dbName in URL: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/01acd1e90f75bfaf.
Report an issue: GitHub.