{"record":{"id":"4df7bd87dbdb60e4","repo":"NationalSecurityAgency/ghidra","slug":"must-specify-md5-or-name-option","errorCode":null,"errorMessage":"Must specify \"md5=\" or \"name=\" option","messagePattern":"Must specify \"md5=\" or \"name=\" option","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java","lineNumber":545,"sourceCode":"\t\tFile dir = generateUpdatesFromServer(ghidraURL, xmlDirectory, overwrite, null, monitor);\n\t\tsendUpdateToServer(dir);\n\t\tif (usestmpdir) {\n\t\t\tdeleteTemporaryDirectory(dir);\n\t\t}\n\t}\n\n\t/**\n\t * Deletes a specified executable from the database.\n\t * \n\t * @param md5 the MD5 of the executable to delete\n\t * @param name the name of the executable to delete\n\t * @throws IOException if there's an error establishing the database connection\n\t * @throws LSHException if there's an error issuing the query\n\t */\n\tpublic void deleteExecutable(String md5, String name) throws IOException, LSHException {\n\n\t\tif (StringUtils.isAnyBlank(md5) && StringUtils.isAnyBlank(name)) {\n\t\t\tthrow new IOException(\"Must specify \\\"md5=\\\" or \\\"name=\\\" option\");\n\t\t}\n\n\t\tExeSpecifier spec = new ExeSpecifier();\n\t\tspec.exemd5 = md5;\n\t\tspec.exename = name;\n\t\tspec.arch = null;\n\t\tspec.execompname = null;\n\n\t\tdeleteExecutables(spec);\n\t}\n\n\t/**\n\t * Deletes a specified executable from the database.\n\t * \n\t * @param spec the spec that indicates what executable to delete\n\t * @throws IOException if there's an error establishing the database connection\n\t * @throws LSHException if there's an error issuing the query\n\t */","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java#L527-L563","documentation":"Thrown by deleteExecutable(md5, name) when both md5 and name are blank (StringUtils.isAnyBlank returns true for each). At least one identifier is required to locate the executable to delete; supplying neither is an input error surfaced as an IOException (the method's declared checked exception). Note the condition is AND: both must be blank to trigger.","triggerScenarios":"Calling deleteExecutable(null, null), deleteExecutable(\"\", \"\"), or with whitespace-only values for both. Also via the CLI 'delete' command invoked without 'md5=' or 'name='.","commonSituations":"CLI invocation missing both 'md5=' and 'name=' options; programmatic delete with unpopulated fields; upstream code failed to resolve an identifier before calling.","solutions":["Provide a non-blank md5 and/or name when calling deleteExecutable (or 'md5='/'name=' on the CLI).","Validate that at least one identifier is set before issuing the call.","If resolving the identifier upstream failed, fix that lookup rather than calling delete blind."],"exampleFix":"// before\nbsim.deleteExecutable(md5, name);  // both null/blank\n\n// after\nif (StringUtils.isAllBlank(md5) && StringUtils.isAllBlank(name)) {\n    throw new IllegalArgumentException(\"Need md5 or name\");\n}\nbsim.deleteExecutable(md5, name);","handlingStrategy":"validation","validationCode":"if (StringUtils.isAllBlank(md5) && StringUtils.isAllBlank(name)) {\n    throw new IllegalArgumentException(\"Must specify md5 and/or name to delete\");\n}\nbsim.deleteExecutable(md5, name);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require at least one of md5 or name before calling deleteExecutable.","On the CLI always pass 'md5=' or 'name='.","Resolve identifiers upstream and fail before invoking delete."],"tags":["bsim","delete","argument-validation","ioexception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}