NationalSecurityAgency/ghidra · error · IllegalArgumentException

Missing dbName in URL: {}

Error message

Missing dbName in URL: {}

What it means

Thrown by the BSimServerInfo(URL) constructor for postgres/elastic URLs when the URL path does not start with '/'. The path segment (after the host:port) must contain the database name, and a leading slash is the delimiter that signals a path is present. Throws IllegalArgumentException.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java:198

			port = p <= 0 ? DEFAULT_ELASTIC_PORT : p;
		}
		else if (protocol.startsWith("file")) {
			t = DBType.file;
			host = null;
			userinfo = null;
			port = -1;
			if (!"".equals(url.getHost())) {
				throw new IllegalArgumentException("Remote file URL not supported: " + url);
			}
		}
		else {
			throw new IllegalArgumentException("Unsupported BSim URL protocol: " + protocol);
		}
		dbType = t;

		if (dbType == DBType.postgres || dbType == DBType.elastic) {
			if (!path.startsWith("/")) {
				throw new IllegalArgumentException("Missing dbName in URL: " + url);
			}
			path = path.substring(1).strip();
		}
		path = urlDecode(checkURLField(path, "path"));
		if (dbType == DBType.file) {
			path = cleanupFilename(path);
		}
		else if (path.contains("/")) {
			throw new IllegalArgumentException("Invalid dbName in URL: " + path);
		}
		dbName = path;
	}

	private static String getURLUserInfo(URL url) {

		String userinfo = url.getUserInfo();
		if (userinfo == null) {
			return null;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Append the database name as a path, e.g. 'postgresql://host:5432/bsimdb'.
  2. Validate the URL path is non-empty and starts with '/' before constructing.
  3. Use BSimServerInfo's helper methods or the multi-arg constructor if the path is uncertain.

Example fix

// before
new BSimServerInfo(new URL("postgresql://host:5432"));
// after (include dbname in path)
new BSimServerInfo(new URL("postgresql://host:5432/bsimdb"));
Defensive patterns

Strategy: validation

Validate before calling

if (("postgresql".equals(proto) || "https".equals(proto) || "elastic".equals(proto)) && !url.getPath().startsWith("/")) {
    throw new IllegalArgumentException("URL must include a /<dbname> path");
}

Prevention

When it happens

Trigger: Constructing from a URL like 'postgresql://host:5432' (no trailing path) or 'postgresql://host:5432?' where the path is empty.

Common situations: Omitting the database name in a BSim URL; building the URL by string concatenation that dropped the '/dbname' segment.

Related errors


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