NationalSecurityAgency/ghidra · error · IllegalArgumentException

Invalid repository URL: {}

Error message

Invalid repository URL: {}

What it means

Thrown by setupGhidraURL() when the URL passes isGhidraURL() (has the ghidra scheme) but is neither a server repository URL (isServerRepositoryURL) nor a local project URL (isLocalURL). This means the ghidra:// URL is structurally valid but lacks required components like a host or repository name.

Source

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

			serverInfo = new BSimServerInfo(bsimURL);
		}
		String connectingUserName = optionValueMap.get(USER_OPTION);
		return new BulkSignatures(serverInfo, connectingUserName);
	}

	private void setupGhidraURL(String ghidraURLString) throws IllegalArgumentException {

		if (ghidraURLString == null) {
			return;
		}

		if (!GhidraURL.isGhidraURL(ghidraURLString)) {
			throw new IllegalArgumentException("URL is not ghidra protocol: " + ghidraURLString);
		}
		ghidraURL = GhidraURL.toURL(ghidraURLString);
		if (!GhidraURL.isServerRepositoryURL(ghidraURL) &&
			!GhidraURL.isLocalURL(ghidraURL)) {
			throw new IllegalArgumentException("Invalid repository URL: " + ghidraURLString);
		}
	}

	/**
	 * Establish the URL for the ghidra server and/or the bsim server. At least one string must be non-null
	 * @param ghidraURLString is the URL string for the ghidra server
	 * @param bsimURLString is the URL string for the bsim server
	 * @throws MalformedURLException if there is a problem parsing the given URLs
	 * @throws URISyntaxException if there is a problem parsing the given URLs
	 * @throws IllegalArgumentException if unsupported URL use occurs
	 */
	private void setupURLs(String ghidraURLString, String bsimURLString)
			throws MalformedURLException, URISyntaxException {

		if (ghidraURLString != null) {
			setupGhidraURL(ghidraURLString);
		}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Ensure the URL includes both a host and a repository name: ghidra://<host>/<repository-name>.
  2. For local repositories, use the format ghidra:<file-system-path-to-project> as generated by Ghidra.
  3. Generate the URL from within Ghidra (Repository > Copy URL) to ensure correct structure.

Example fix

// before
bsim generatesigs ghidra://myserver/ --bsim h2://localhost/bsimdb
// error: Invalid repository URL: ghidra://myserver/

// after
bsim generatesigs ghidra://myserver/MyRepository --bsim h2://localhost/bsimdb
Defensive patterns

Strategy: validation

Validate before calling

URL url = GhidraURL.toURL(urlString);
if (!GhidraURL.isServerRepositoryURL(url) && !GhidraURL.isLocalURL(url)) {
    throw new IllegalArgumentException(
        "URL must be a ghidra server repository or local project URL: " + urlString);
}

Prevention

When it happens

Trigger: A ghidra:// URL with an empty repository name (e.g., 'ghidra://host/'), a ghidra:// URL pointing at a non-repository resource, or a URL with an unexpected path structure that GhidraURL cannot classify.

Common situations: Truncated or mistyped repository URL; using a URL meant for a different Ghidra protocol use (e.g., a ghidra:// URL to a specific program rather than a repository root).

Related errors


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