NationalSecurityAgency/ghidra · error · IOException

Must specify "md5=" or "name=" option

Error message

Must specify "md5=" or "name=" option

What it means

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.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java:545

		File dir = generateUpdatesFromServer(ghidraURL, xmlDirectory, overwrite, null, monitor);
		sendUpdateToServer(dir);
		if (usestmpdir) {
			deleteTemporaryDirectory(dir);
		}
	}

	/**
	 * Deletes a specified executable from the database.
	 * 
	 * @param md5 the MD5 of the executable to delete
	 * @param name the name of the executable to delete
	 * @throws IOException if there's an error establishing the database connection
	 * @throws LSHException if there's an error issuing the query
	 */
	public void deleteExecutable(String md5, String name) throws IOException, LSHException {

		if (StringUtils.isAnyBlank(md5) && StringUtils.isAnyBlank(name)) {
			throw new IOException("Must specify \"md5=\" or \"name=\" option");
		}

		ExeSpecifier spec = new ExeSpecifier();
		spec.exemd5 = md5;
		spec.exename = name;
		spec.arch = null;
		spec.execompname = null;

		deleteExecutables(spec);
	}

	/**
	 * Deletes a specified executable from the database.
	 * 
	 * @param spec the spec that indicates what executable to delete
	 * @throws IOException if there's an error establishing the database connection
	 * @throws LSHException if there's an error issuing the query
	 */

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Provide a non-blank md5 and/or name when calling deleteExecutable (or 'md5='/'name=' on the CLI).
  2. Validate that at least one identifier is set before issuing the call.
  3. If resolving the identifier upstream failed, fix that lookup rather than calling delete blind.

Example fix

// before
bsim.deleteExecutable(md5, name);  // both null/blank

// after
if (StringUtils.isAllBlank(md5) && StringUtils.isAllBlank(name)) {
    throw new IllegalArgumentException("Need md5 or name");
}
bsim.deleteExecutable(md5, name);
Defensive patterns

Strategy: validation

Validate before calling

if (StringUtils.isAllBlank(md5) && StringUtils.isAllBlank(name)) {
    throw new IllegalArgumentException("Must specify md5 and/or name to delete");
}
bsim.deleteExecutable(md5, name);

Prevention

When it happens

Trigger: Calling deleteExecutable(null, null), deleteExecutable("", ""), or with whitespace-only values for both. Also via the CLI 'delete' command invoked without 'md5=' or 'name='.

Common situations: CLI invocation missing both 'md5=' and 'name=' options; programmatic delete with unpopulated fields; upstream code failed to resolve an identifier before calling.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/4df7bd87dbdb60e4. Report an issue: GitHub.