NationalSecurityAgency/ghidra · error · IllegalArgumentException

Must specify either --bsim or --config option

Error message

Must specify either --bsim or --config option

What it means

Thrown by processSigAndUpdateOptions() when neither --bsim nor --config is supplied to a generatesigs or generateupdates command. BSim needs exactly one of these to know which BSim database will receive the generated signatures: --bsim points at a live BSim server URL for direct commit, while --config provides a configuration template name (e.g. medium_64) for generating signature XML files only. Without either, the command has no target and cannot proceed.

Source

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

		}
	}

	private void processSigAndUpdateOptions(String urlstring)
			throws IllegalArgumentException, MalformedURLException, URISyntaxException {
		String bsimURLOption = optionValueMap.get(BSIM_URL_OPTION);
		String configOption = optionValueMap.get(CONFIG_OPTION);
		if (configOption != null) {
			if (bsimURLOption != null) {
				throw new IllegalArgumentException(
					BSIM_URL_OPTION + " and " + CONFIG_OPTION + " options may not both be present");
			}
			setupGhidraURL(urlstring);
		}
		else if (bsimURLOption != null) {
			setupURLs(urlstring, bsimURLOption);
		}
		else {
			throw new IllegalArgumentException(
				"Must specify either " + BSIM_URL_OPTION + " or " + CONFIG_OPTION + " option");
		}
	}

	/**
	 * Runs the command specified by the given set of params.
	 * 
	 * @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

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Add exactly one of: --bsim <bsimURL> (to commit directly) or --config <template> (to write XML files).
  2. Run 'bsim' with no arguments to see the usage block (lines 1020-1066) which lists the three valid generatesigs/generateupdates invocations.
  3. If committing to a server, use the form: generatesigs <ghidraURL> --bsim|-b <bsimURL> [--commit].
  4. If generating XML only, use: generatesigs <ghidraURL> </xmldirectory> --config|-c <template> [--overwrite].

Example fix

// before
bsim generatesigs ghidra://myhost/MyRepo
// after
bsim generatesigs ghidra://myhost/MyRepo --bsim postgresql://myhost/BsimDB
// or
bsim generatesigs ghidra://myhost/MyRepo /tmp/xmlout --config medium_64
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight check before calling run() for generatesigs/generateupdates
String bsimOpt = optionValueMap.get("--bsim");
String configOpt = optionValueMap.get("--config");
if (bsimOpt == null && configOpt == null) {
    throw new IllegalArgumentException(
        "generatesigs/generateupdates requires either --bsim <url> or --config <template>");
}

Prevention

When it happens

Trigger: Running 'generatesigs <ghidraURL>' or 'generateupdates <ghidraURL>' without any --bsim or --config option on the command line. The check at BSimLaunchable.java:498-513 finds both optionValueMap.get(BSIM_URL_OPTION) and optionValueMap.get(CONFIG_OPTION) are null after readOptions() has parsed args.

Common situations: Following a tutorial that shows the short form '-b <url>' but typing it wrong; assuming the tool infers the BSim target from the ghidra URL argument; upgrading from an older BSim version where the option was optional; forgetting the option entirely when scripting a bulk signature generation pipeline.

Related errors


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