{"record":{"id":"8b7d0ff7c7eed082","repo":"NationalSecurityAgency/ghidra","slug":"missing-or-invalid-command-specified","errorCode":null,"errorMessage":"Missing or invalid command specified","messagePattern":"Missing or invalid command specified","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":400,"sourceCode":"\t}\n\n\t/**\n\t * Runs the command specified by the given set of params.\n\t * \n\t * @param params the parameters specifying the command\n\t * @param monitor the task monitor\n\t * @throws IllegalArgumentException if invalid params have been specified\n\t * @throws Exception if there's an error during the operation\n\t * @throws CancelledException if processing is cancelled\n\t */\n\tpublic void run(String[] params, TaskMonitor monitor) throws Exception, CancelledException {\n\n\t\tclearParams();\n\n\t\tcheckRequiredParam(params, 0, \"command\");\n\t\tString command = params[0];\n\t\tif (!COMMAND_SET.contains(command)) {\n\t\t\tthrow new IllegalArgumentException(\"Missing or invalid command specified\");\n\t\t}\n\n\t\tcheckRequiredParam(params, 1, \"URL\");\n\t\tString urlstring = params[1];\n\n\t\tmonitor.setCancelEnabled(true);\n\n\t\tList<String> subParams = readOptions(command, params, 2);\n\n\t\tinitializeApplication(command);\n\n\t\tif (COMMAND_CREATE_DATABASE.equals(command)) {\n\t\t\tbsimURL = BSimClientFactory.deriveBSimURL(urlstring);\n\t\t\tdoCreateDatabase(subParams);\n\t\t}\n\t\telse if (COMMAND_DROP_DATABASE.equals(command)) {\n\t\t\tbsimURL = BSimClientFactory.deriveBSimURL(urlstring);\n\t\t\tdoDropDatabase(subParams);","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L382-L418","documentation":"Thrown by run() when params[0] is not in COMMAND_SET. The valid commands are: createdatabase, dropdatabase, setmetadata, getmetadata, addexecategory, addfunctiontag, dropindex, rebuildindex, prewarm, generatesigs, commitsigs, generateupdates, commitupdates, delete, listfuncs, listexes, getexecount, dumpsigs. Any other string in the command position is rejected.","triggerScenarios":"Misspelling a command name (e.g., 'createdb' instead of 'createdatabase', 'gensigs' instead of 'generatesigs'); using a deprecated or removed command name; passing a file path or URL as the first argument instead of a command name.","commonSituations":"Typo in the command; using a command name from a different version of Ghidra that renamed or removed it; wrapper script that passes arguments in the wrong order.","solutions":["Verify the command name is spelled exactly as defined in the defineCommand() calls (lines 59-76).","Check the Ghidra/BSim documentation for the current list of supported commands.","Ensure no extra arguments precede the command name (e.g., flags like --verbose are not supported before the command)."],"exampleFix":"// before\nbsim gensigs ghidra://server/Repo --bsim h2://localhost/db\n// error: Missing or invalid command specified\n\n// after\nbsim generatesigs ghidra://server/Repo --bsim h2://localhost/db","handlingStrategy":"validation","validationCode":"Set<String> validCommands = Set.of(\n    \"createdatabase\",\"dropdatabase\",\"setmetadata\",\"getmetadata\",\n    \"addexecategory\",\"addfunctiontag\",\"dropindex\",\"rebuildindex\",\n    \"prewarm\",\"generatesigs\",\"commitsigs\",\"generateupdates\",\n    \"commitupdates\",\"delete\",\"listfuncs\",\"listexes\",\"getexecount\",\"dumpsigs\");\nif (!validCommands.contains(command)) {\n    System.err.println(\"Unknown command: \" + command);\n    System.err.println(\"Valid commands: \" + validCommands);\n    return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the command name against the list defined by defineCommand() calls (lines 59-76).","Check for typos — command names are single words with no hyphens or underscores.","Consult BSim documentation for the current command set in your Ghidra version."],"tags":["bsim","ghidra","command-line","argument-parsing","cli-usage"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}