NationalSecurityAgency/ghidra · error · IllegalArgumentException
Unable to infer ghidra URL from BSim file DB URL
Error message
Unable to infer ghidra URL from BSim file DB URL
What it means
Thrown by setupURLs() when no explicit ghidra URL was provided and the BSim URL uses the 'file' protocol. A file-based BSim database (local H2 file) has no associated network host, so the system cannot infer a ghidra server repository URL from it. The code needs either an explicit ghidra URL or a network-based BSim URL to derive one.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:261
* Establish the URL for the ghidra server and/or the bsim server. At least one string must be non-null
* @param ghidraURLString is the URL string for the ghidra server
* @param bsimURLString is the URL string for the bsim server
* @throws MalformedURLException if there is a problem parsing the given URLs
* @throws URISyntaxException if there is a problem parsing the given URLs
* @throws IllegalArgumentException if unsupported URL use occurs
*/
private void setupURLs(String ghidraURLString, String bsimURLString)
throws MalformedURLException, URISyntaxException {
if (ghidraURLString != null) {
setupGhidraURL(ghidraURLString);
}
if (bsimURLString != null) {
bsimURL = BSimClientFactory.deriveBSimURL(bsimURLString);
if (ghidraURL == null) {
if ("file".equals(bsimURL.getProtocol())) {
throw new IllegalArgumentException(
"Unable to infer ghidra URL from BSim file DB URL");
}
// Derive Ghidra URL from BSim DB host and dbName
String path = bsimURL.getPath();
try {
path = URLDecoder.decode(path, "UTF-8");
}
catch (UnsupportedEncodingException e) {
throw new MalformedURLException(e.getMessage());
}
String dbName = path.substring(path.lastIndexOf('/') + 1);
ghidraURL = GhidraURL.makeURL(bsimURL.getHost(), -1, dbName);
}
}
else if (ghidraURLString != null) {
bsimURL = BSimClientFactory.deriveBSimURL(ghidraURLString);View on GitHub (pinned to d5f144c24d)
Solutions
- Provide an explicit ghidra repository URL as the first positional argument: bsim generatesigs ghidra://server/Repo --bsim h2:file:/path/to/db.
- Use the --config option with a configuration file that specifies both the ghidra source and BSim target.
- If the BSim database is on a network server (not a local file), use a network BSim URL instead of a file:// URL so the host can be inferred.
Example fix
// before bsim generatesigs h2:file:/data/bsimdb // error: Unable to infer ghidra URL from BSim file DB URL // after bsim generatesigs ghidra://ghidraserver/MyRepo --bsim h2:file:/data/bsimdb
Defensive patterns
Strategy: validation
Validate before calling
if (ghidraURLString == null && bsimURLString != null) {
URL bsimUrl = BSimClientFactory.deriveBSimURL(bsimURLString);
if ("file".equals(bsimUrl.getProtocol()) && configOption == null) {
throw new IllegalArgumentException(
"A ghidra repository URL or --config must be provided when using a file-based BSim URL");
}
} Prevention
- Always provide an explicit ghidra repository URL when using file-based BSim databases.
- Use --config for complex setups to specify both ghidra and BSim targets in one file.
- Remember that file:// BSim URLs have no host, so ghidra URL inference is impossible.
When it happens
Trigger: Running 'generatesigs' or 'generateupdates' with a file-based BSim URL (e.g., h2:file:/path/to/db) and neither a --config option nor an explicit ghidra URL. The tool tries to derive ghidraURL from the BSim URL's host, but file:// URLs have no host.
Common situations: Using a local BSim database for testing but forgetting to also specify a ghidra repository URL or a config file; mixing local and server deployment paradigms.
Related errors
- URL is not ghidra protocol: {}
- Invalid repository URL: {}
- --bsim and --config options may not both be present
- Protocol not permissable for BSim URL
- BSim URL missing DB name/path
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/437e4f120b1c52bb.
Report an issue: GitHub.