NationalSecurityAgency/ghidra · error · MalformedURLException
Unsupported repository URL: {ghidraURL}
Error message
Unsupported repository URL: {ghidraURL} What it means
Thrown by IterateRepository.process when the provided URL is neither a server repository URL (GhidraURL.isServerRepositoryURL returns false) nor a local URL (GhidraURL.isLocalURL returns false). IterateRepository only supports Ghidra server repository URLs (ghidra:// or https://) and local file URLs. Any other scheme or malformed URL is rejected.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/IterateRepository.java:57
* @throws IOException if an error occured during processing.
* @throws CancelledException if processing was cancelled
*/
protected abstract void process(Program program, TaskMonitor monitor)
throws IOException, CancelledException;
/**
* Process the specified repository URL
* @param ghidraURL ghidra URL for existing server repository and optional
* folder path
* @param monitor task monitor
* @throws Exception if an error occurs during processing
* @throws CancelledException if processing is cancelled
*/
public void process(URL ghidraURL, TaskMonitor monitor) throws Exception, CancelledException {
if (!GhidraURL.isServerRepositoryURL(ghidraURL) &&
!GhidraURL.isLocalURL(ghidraURL)) {
throw new MalformedURLException("Unsupported repository URL: " + ghidraURL);
}
// Query URL - may be either file or folder (no link following)
GhidraURLQuery.queryUrl(ghidraURL, null, new GhidraURLResultHandlerAdapter(true) {
@Override
public void processResult(DomainFolder domainFolder, URL url, TaskMonitor m)
throws IOException, CancelledException {
int totalFiles = getTotalFileCount(domainFolder);
monitor.setMaximum(totalFiles);
monitor.setShowProgressValue(true);
process(domainFolder, monitor);
}
@OverrideView on GitHub (pinned to d5f144c24d)
Solutions
- For local projects, use GhidraURL.toLocalURL(domainFolder) or GhidraURL.getLocalURL(project, path) to construct a valid local URL.
- For server repositories, use GhidraURL.toServerRepositoryURL(host, port, repoName) or the equivalent.
- Verify the URL scheme: server repos use 'ghidra://' or 'https://', local URLs use 'file://' with Ghidra project structure.
- Print the URL before passing it to process() to verify the format.
Example fix
// before
if (!GhidraURL.isServerRepositoryURL(ghidraURL) && !GhidraURL.isLocalURL(ghidraURL)) {
throw new MalformedURLException("Unsupported repository URL: " + ghidraURL);
}
// caller fix — construct a proper URL
// before (wrong):
// URL url = new URL("file:/path/to/project/folder");
// iter.process(url, monitor);
// after (correct):
// URL url = GhidraURL.toLocalURL(domainFolder);
// iter.process(url, monitor); Defensive patterns
Strategy: validation
Validate before calling
// Validate the URL type before calling process
if (ghidraURL == null) {
throw new IllegalArgumentException("ghidraURL must not be null");
}
if (!GhidraURL.isServerRepositoryURL(ghidraURL) && !GhidraURL.isLocalURL(ghidraURL)) {
throw new IllegalArgumentException(
"URL must be a Ghidra server repository URL or local URL: " + ghidraURL +
". Use GhidraURL.toServerRepositoryURL() or GhidraURL.toLocalURL() to construct.");
} Type guard
public static boolean isProcessableRepositoryURL(URL url) {
return url != null &&
(GhidraURL.isServerRepositoryURL(url) || GhidraURL.isLocalURL(url));
} Try / catch
// Validation-based — check URL format before calling process
if (!isProcessableRepositoryURL(ghidraURL)) {
// Try converting a filesystem path to a local URL
// Or report the error with guidance
throw new IllegalArgumentException(
"Unsupported URL format. Expected ghidra:// or local Ghidra project URL.");
}
repo.process(ghidraURL, monitor); Prevention
- Always construct repository URLs using GhidraURL helper methods (toLocalURL, toServerRepositoryURL).
- Never pass raw filesystem paths or non-Ghidra URL schemes to IterateRepository.process.
- Validate the URL format before calling process to fail fast with a clear message.
- Print the URL before processing to debug format issues.
When it happens
Trigger: Passing a URL with an unsupported scheme (e.g., http://, ftp://), a plain filesystem path that is not wrapped as a Ghidra local URL, a malformed URL string, or a URL pointing to a non-repository resource. GhidraURL requires specific formats: 'ghidra://host/repo/folder' for server repos or local project paths formatted as Ghidra local URLs.
Common situations: Passing a raw filesystem path instead of converting it to a GhidraURL first; typo in the URL scheme; pointing at a web URL instead of a Ghidra repository server; using a URL format from a different Ghidra version; the URL was constructed without GhidraURL.toURL helpers.
Related errors
- Protocol not permissable for BSim URL
- BSim URL missing DB name/path
- BSim URL must specify exactly 1 path element
- URL is missing a repository path
- Unsupported protocol: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/29e59956406eaad6.
Report an issue: GitHub.