NationalSecurityAgency/ghidra · error · IllegalArgumentException
Unsupported repository URL: {repo}
Error message
Unsupported repository URL: {repo} What it means
Thrown by ExecutableRecord.setRepository when the provided repo string parses to a URL that is neither a Ghidra server repository URL (GhidraURL.isServerRepositoryURL) nor a local URL (GhidraURL.isLocalURL). It is an IllegalArgumentException (unchecked), raised from the ExecutableRecord constructor path. Only Ghidra-local or Ghidra-server repository URLs are accepted as a repository origin.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/ExecutableRecord.java:246
md5sum = calcLibraryMd5Placeholder(enm, arc);
usercat = null;
xrefIndex = 0;
}
/**
* Set the repository and path Strings for an executable, replacing
* any previous setting. Truncate any trailing slash.
* @param repo is (URL) string indicating which repository contains this executable
* @param newpath is the path, relative to the repository, to the executable
* @throws IllegalArgumentException if invalid repo URL specified
*/
protected void setRepository(String repo, String newpath) {
repository = null;
if (repo != null) {
URL ghidraURL = GhidraURL.toURL(repo);
if (!GhidraURL.isServerRepositoryURL(ghidraURL) &&
!GhidraURL.isLocalURL(ghidraURL)) {
throw new IllegalArgumentException("Unsupported repository URL: " + repo);
}
URL projectURL = GhidraURL.getProjectURL(ghidraURL);
repository = projectURL.toExternalForm();
}
path = newpath;
if ((path != null) && (path.charAt(path.length() - 1) == '/')) { // No slash at end of path string
if (path.length() == 1) {
path = null;
}
else {
path = path.substring(0, path.length() - 1);
}
}
if ((path != null) && (path.charAt(0) == '/')) { // No slash at beginning of path
if (path.length() == 1) {
path = null;
}View on GitHub (pinned to d5f144c24d)
Solutions
- Use a GhidraURL string (as produced by GhidraURL) for the repo parameter, or pass null when no repository applies.
- Verify GhidraURL.isServerRepositoryURL or GhidraURL.isLocalURL returns true for the candidate URL before constructing the record.
- Correct the scheme/host/path to match the expected Ghidra repository URL format.
Example fix
// before
man.newExecutableRecord(md5, name, comp, arch, date, "https://myhost/data", path, id);
// after
String repo = GhidraURL.toURL("myserver", "myrepo").toString(); // valid Ghidra URL
man.newExecutableRecord(md5, name, comp, arch, date, repo, path, id); Defensive patterns
Strategy: validation
Validate before calling
URL u = GhidraURL.toURL(repo);
if (repo != null && !GhidraURL.isServerRepositoryURL(u) && !GhidraURL.isLocalURL(u)) {
throw new IllegalArgumentException("repo is not a Ghidra URL: " + repo);
}
man.newExecutableRecord(md5, name, comp, arch, date, repo, path, id); Type guard
boolean isSupportedRepoUrl(String repo) {
if (repo == null) return true;
URL u = GhidraURL.toURL(repo);
return GhidraURL.isServerRepositoryURL(u) || GhidraURL.isLocalURL(u);
} Try / catch
try {
man.newExecutableRecord(md5, name, comp, arch, date, repo, path, id);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unsupported repository URL")) {
man.newExecutableRecord(md5, name, comp, arch, date, null, path, id);
} else throw e;
} Prevention
- Use GhidraURL-formatted strings for the repo parameter, or pass null.
- Build the repo URL via GhidraURL APIs rather than hand-writing it.
- Validate the URL form before constructing an ExecutableRecord.
When it happens
Trigger: Constructing an ExecutableRecord (via newExecutableRecord / setRepository) with a repo string that is a non-Ghidra URL scheme or an unsupported form (e.g. an arbitrary http path, a bare file path, an ftp URL).
Common situations: Passing a plain web URL or filesystem path instead of a GhidraURL-formatted string; repo string pointing at a Ghidra server but missing the required scheme/format; typo in the repository URL.
Related errors
- Error parsing URL: {message}
- Invalid MD5 hash string: {md5}
- URL path must indicate the repository only
- Bad database URL: ${e.getMessage()}
- Unsupported value: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/31d57632bb509ad9.
Report an issue: GitHub.