NationalSecurityAgency/ghidra · error · IllegalArgumentException
Unsupported BSim URL protocol: {}
Error message
Unsupported BSim URL protocol: {} What it means
Thrown by the BSimServerInfo(URL) constructor when the URL protocol is none of 'postgresql', 'https', 'elastic', or a 'file'-prefixed scheme. BSim only recognizes those four protocol families. Throws IllegalArgumentException.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java:192
}
else if (protocol.equals("https") || protocol.equals("elastic")) {
t = DBType.elastic;
host = checkURLField(url.getHost(), "host");
userinfo = getURLUserInfo(url);
int p = url.getPort();
port = p <= 0 ? DEFAULT_ELASTIC_PORT : p;
}
else if (protocol.startsWith("file")) {
t = DBType.file;
host = null;
userinfo = null;
port = -1;
if (!"".equals(url.getHost())) {
throw new IllegalArgumentException("Remote file URL not supported: " + url);
}
}
else {
throw new IllegalArgumentException("Unsupported BSim URL protocol: " + protocol);
}
dbType = t;
if (dbType == DBType.postgres || dbType == DBType.elastic) {
if (!path.startsWith("/")) {
throw new IllegalArgumentException("Missing dbName in URL: " + url);
}
path = path.substring(1).strip();
}
path = urlDecode(checkURLField(path, "path"));
if (dbType == DBType.file) {
path = cleanupFilename(path);
}
else if (path.contains("/")) {
throw new IllegalArgumentException("Invalid dbName in URL: " + path);
}
dbName = path;
}View on GitHub (pinned to d5f144c24d)
Solutions
- Use one of the supported protocols: postgresql://, https://, elastic://, or file:.
- If targeting Elasticsearch, use 'https://' or 'elastic://' (not 'http://').
- Verify the URL scheme matches the actual BSim backend type.
Example fix
// before
new BSimServerInfo(new URL("http://host:9200/bsim"));
// after (https for elastic)
new BSimServerInfo(new URL("https://host:9200/bsim")); Defensive patterns
Strategy: validation
Validate before calling
Set<String> supported = Set.of("postgresql","https","elastic");
String proto = url.getProtocol();
if (!supported.contains(proto) && !proto.startsWith("file")) {
throw new IllegalArgumentException("Unsupported BSim URL protocol: " + proto);
} Prevention
- Restrict BSim URLs to postgresql://, https://, elastic://, or file: schemes.
- Use https:// (not http://) for Elasticsearch backends.
- Validate the protocol against the supported set before constructing.
When it happens
Trigger: Constructing BSimServerInfo from a URL with an unsupported scheme, e.g. 'mysql://host/db' or 'http://host/db' (note: http is not accepted, only https/elastic).
Common situations: Using a JDBC-style URL or a non-BSim protocol; typo in the scheme; confusing BSim URLs with standard database connection URLs.
Related errors
- host required
- Non-empty dbName required
- Invalid {} dbName: {}
- Remote file URL not supported: {}
- Missing dbName in URL: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/c5561fa3b4ff8565.
Report an issue: GitHub.