{"record":{"id":"91e0afd03399be7a","repo":"NationalSecurityAgency/ghidra","slug":"unexpected-parameter","errorCode":null,"errorMessage":"Unexpected parameter: {}","messagePattern":"Unexpected parameter: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":537,"sourceCode":"\t * @param params the parameters specifying the command\n\t * @throws Exception when initializing the application or executing the command\n\t */\n\tpublic void run(String[] params) throws Exception {\n\t\trun(params, TaskMonitor.DUMMY);\n\t}\n\n\t/**\n\t * Creates a new BSim database with a given set of properties.\n\t * \n\t * @param params the command-line parameters\n\t * @throws IOException if there's an error establishing the database connection\n\t */\n\tprivate void doCreateDatabase(List<String> params) throws IOException {\n\t\tif (params.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"Missing database template\");\n\t\t}\n\t\telse if (params.size() > 1) {\n\t\t\tthrow new IllegalArgumentException(\"Unexpected parameter: \" + params.get(1));\n\t\t}\n\n\t\tString configTemplate = params.get(0);\n\t\tboolean noTrackCallGraph = booleanOptions.contains(NO_CALLGRAPH_OPTION);\n\n\t\tString nameOption = optionValueMap.get(NAME_OPTION);\n\t\tString ownerOption = optionValueMap.get(OWNER_OPTION);\n\t\tString descOption = optionValueMap.get(DESCRIPTION_OPTION);\n\n\t\ttry (BulkSignatures bsim = getBulkSignatures()) {\n\t\t\tbsim.createDatabase(configTemplate, nameOption, ownerOption, descOption,\n\t\t\t\t!noTrackCallGraph);\n\t\t}\n\t}\n\n\t/**\n\t * Drops the current BSim database.\n\t * ","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L519-L555","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nbsim createdatabase postgresql://myhost/BsimDB medium_64 extra_arg\n// after\nbsim createdatabase postgresql://myhost/BsimDB medium_64 --name \"My DB\"","handlingStrategy":"validation","validationCode":"// After readOptions, for createdatabase ensure exactly one positional\nif (\"createdatabase\".equals(command) && positionalParams.size() != 1) {\n    throw new IllegalArgumentException(\"createdatabase takes exactly one template argument\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Count positional args (non '-' tokens) before the command to catch extras early.","Quote shell variables to avoid glob expansion injecting tokens."],"tags":["cli","argument-validation","bsim","createdatabase"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}