NationalSecurityAgency/ghidra · error · IllegalArgumentException

Invalid dbName in URL: {}

Error message

Invalid dbName in URL: {}

What it means

Thrown by the BSimServerInfo(URL) constructor for postgres/elastic URLs when, after stripping the leading slash, the database name still contains a '/'. Network database names must be a single path segment; a multi-segment path indicates an invalid or misplaced database name. Throws IllegalArgumentException.

Source

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

			}
		}
		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;
		}

		int pwSep = userinfo.indexOf(':');
		String urlUserInfo;
		if (pwSep >= 0) {
			urlUserInfo = urlDecode(userinfo.substring(0, pwSep)) + ":" +
				urlDecode(userinfo.substring(pwSep + 1));
		}
		else {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Use a single-segment database name in the URL path, e.g. 'postgresql://host:5432/bsimdb'.
  2. If you intended a file path, use the file:// protocol instead.
  3. Sanitize the path so it contains no slashes after the leading one.

Example fix

// before
new BSimServerInfo(new URL("postgresql://host:5432/apps/bsimdb"));
// after (single-segment name)
new BSimServerInfo(new URL("postgresql://host:5432/bsimdb"));
Defensive patterns

Strategy: validation

Validate before calling

String path = url.getPath().substring(1);
if (path.contains("/")) {
    throw new IllegalArgumentException("postgres/elastic dbName must be a single path segment: " + path);
}

Prevention

When it happens

Trigger: Constructing from a URL like 'postgresql://host:5432/foo/bar' where the path after the host contains more than one segment.

Common situations: Embedding a directory hierarchy in the database name; treating a postgres URL like a file path; URL-encoding mistakes that leave extra slashes.

Related errors


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