{"record":{"id":"e4a4c21e1d5ab3af","repo":"NationalSecurityAgency/ghidra","slug":"invalid-repository-url","errorCode":null,"errorMessage":"Invalid repository URL: {}","messagePattern":"Invalid repository URL: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":238,"sourceCode":"\t\t\tserverInfo = new BSimServerInfo(bsimURL);\n\t\t}\n\t\tString connectingUserName = optionValueMap.get(USER_OPTION);\n\t\treturn new BulkSignatures(serverInfo, connectingUserName);\n\t}\n\n\tprivate void setupGhidraURL(String ghidraURLString) throws IllegalArgumentException {\n\n\t\tif (ghidraURLString == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!GhidraURL.isGhidraURL(ghidraURLString)) {\n\t\t\tthrow new IllegalArgumentException(\"URL is not ghidra protocol: \" + ghidraURLString);\n\t\t}\n\t\tghidraURL = GhidraURL.toURL(ghidraURLString);\n\t\tif (!GhidraURL.isServerRepositoryURL(ghidraURL) &&\n\t\t\t!GhidraURL.isLocalURL(ghidraURL)) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid repository URL: \" + ghidraURLString);\n\t\t}\n\t}\n\n\t/**\n\t * Establish the URL for the ghidra server and/or the bsim server. At least one string must be non-null\n\t * @param ghidraURLString is the URL string for the ghidra server\n\t * @param bsimURLString is the URL string for the bsim server\n\t * @throws MalformedURLException if there is a problem parsing the given URLs\n\t * @throws URISyntaxException if there is a problem parsing the given URLs\n\t * @throws IllegalArgumentException if unsupported URL use occurs\n\t */\n\tprivate void setupURLs(String ghidraURLString, String bsimURLString)\n\t\t\tthrows MalformedURLException, URISyntaxException {\n\n\t\tif (ghidraURLString != null) {\n\t\t\tsetupGhidraURL(ghidraURLString);\n\t\t}\n","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L220-L256","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Ensure the URL includes both a host and a repository name: ghidra://<host>/<repository-name>.","For local repositories, use the format ghidra:<file-system-path-to-project> as generated by Ghidra.","Generate the URL from within Ghidra (Repository > Copy URL) to ensure correct structure."],"exampleFix":"// before\nbsim generatesigs ghidra://myserver/ --bsim h2://localhost/bsimdb\n// error: Invalid repository URL: ghidra://myserver/\n\n// after\nbsim generatesigs ghidra://myserver/MyRepository --bsim h2://localhost/bsimdb","handlingStrategy":"validation","validationCode":"URL url = GhidraURL.toURL(urlString);\nif (!GhidraURL.isServerRepositoryURL(url) && !GhidraURL.isLocalURL(url)) {\n    throw new IllegalArgumentException(\n        \"URL must be a ghidra server repository or local project URL: \" + urlString);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the URL includes a repository name in its path component.","Use GhidraURL.isServerRepositoryURL() or GhidraURL.isLocalURL() to validate before use.","Generate URLs from Ghidra's repository browser to ensure correct structure."],"tags":["bsim","ghidra","url-validation","command-line","configuration"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}