NationalSecurityAgency/ghidra · error · IllegalArgumentException
Unexpected parameter: {}
Error message
Unexpected parameter: {} What it means
Thrown by doCreateDatabase() when more than one positional argument is supplied after the bsimURL. createdatabase accepts exactly one positional: the config template. Any additional positional token is treated as an unexpected parameter. The error message interpolates the offending value via params.get(1).
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:537
* @param params the parameters specifying the command
* @throws Exception when initializing the application or executing the command
*/
public void run(String[] params) throws Exception {
run(params, TaskMonitor.DUMMY);
}
/**
* Creates a new BSim database with a given set of properties.
*
* @param params the command-line parameters
* @throws IOException if there's an error establishing the database connection
*/
private void doCreateDatabase(List<String> params) throws IOException {
if (params.isEmpty()) {
throw new IllegalArgumentException("Missing database template");
}
else if (params.size() > 1) {
throw new IllegalArgumentException("Unexpected parameter: " + params.get(1));
}
String configTemplate = params.get(0);
boolean noTrackCallGraph = booleanOptions.contains(NO_CALLGRAPH_OPTION);
String nameOption = optionValueMap.get(NAME_OPTION);
String ownerOption = optionValueMap.get(OWNER_OPTION);
String descOption = optionValueMap.get(DESCRIPTION_OPTION);
try (BulkSignatures bsim = getBulkSignatures()) {
bsim.createDatabase(configTemplate, nameOption, ownerOption, descOption,
!noTrackCallGraph);
}
}
/**
* Drops the current BSim database.
* View on GitHub (pinned to d5f144c24d)
Solutions
- Remove the extra positional argument; createdatabase takes only <bsimURL> <template>.
- Check whether you meant to pass an option (e.g. --name) but forgot the leading '--'.
- Quote arguments to prevent shell expansion from injecting extra tokens.
Example fix
// before bsim createdatabase postgresql://myhost/BsimDB medium_64 extra_arg // after bsim createdatabase postgresql://myhost/BsimDB medium_64 --name "My DB"
Defensive patterns
Strategy: validation
Validate before calling
// After readOptions, for createdatabase ensure exactly one positional
if ("createdatabase".equals(command) && positionalParams.size() != 1) {
throw new IllegalArgumentException("createdatabase takes exactly one template argument");
} Prevention
- Count positional args (non '-' tokens) before the command to catch extras early.
- Quote shell variables to avoid glob expansion injecting tokens.
When it happens
Trigger: Running 'bsim createdatabase <bsimURL> <template> <extra>'. readOptions strips options starting with '-' or '--', but bare positional tokens accumulate in subParams; if two remain after the template, line 537 fires with the second one.
Common situations: Adding a second database name by mistake; a stray file path or copy-paste artifact; shell globbing expanding to multiple tokens; passing an option without its '--' prefix so it's treated as positional.
Related errors
- Missing database template
- Unknown command: {}
- Unsupported command: {}
- Unsupported option use: {}
- Unexpected argument: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/91e0afd03399be7a.
Report an issue: GitHub.