{"record":{"id":"31d57632bb509ad9","repo":"NationalSecurityAgency/ghidra","slug":"unsupported-repository-url-repo","errorCode":null,"errorMessage":"Unsupported repository URL: {repo}","messagePattern":"Unsupported repository URL: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/ExecutableRecord.java","lineNumber":246,"sourceCode":"\t\tmd5sum = calcLibraryMd5Placeholder(enm, arc);\n\t\tusercat = null;\n\t\txrefIndex = 0;\n\t}\n\n\t/**\n\t * Set the repository and path Strings for an executable, replacing\n\t * any previous setting. Truncate any trailing slash.\n\t * @param repo is (URL) string indicating which repository contains this executable\n\t * @param newpath is the path, relative to the repository, to the executable\n\t * @throws IllegalArgumentException if invalid repo URL specified\n\t */\n\tprotected void setRepository(String repo, String newpath) {\n\t\trepository = null;\n\t\tif (repo != null) {\n\t\t\tURL ghidraURL = GhidraURL.toURL(repo);\n\t\t\tif (!GhidraURL.isServerRepositoryURL(ghidraURL) &&\n\t\t\t\t!GhidraURL.isLocalURL(ghidraURL)) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unsupported repository URL: \" + repo);\n\t\t\t}\n\t\t\tURL projectURL = GhidraURL.getProjectURL(ghidraURL);\n\t\t\trepository = projectURL.toExternalForm();\n\t\t}\n\n\t\tpath = newpath;\n\t\tif ((path != null) && (path.charAt(path.length() - 1) == '/')) { // No slash at end of path string\n\t\t\tif (path.length() == 1) {\n\t\t\t\tpath = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpath = path.substring(0, path.length() - 1);\n\t\t\t}\n\t\t}\n\t\tif ((path != null) && (path.charAt(0) == '/')) { // No slash at beginning of path\n\t\t\tif (path.length() == 1) {\n\t\t\t\tpath = null;\n\t\t\t}","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/ExecutableRecord.java#L228-L264","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\nman.newExecutableRecord(md5, name, comp, arch, date, \"https://myhost/data\", path, id);\n\n// after\nString repo = GhidraURL.toURL(\"myserver\", \"myrepo\").toString(); // valid Ghidra URL\nman.newExecutableRecord(md5, name, comp, arch, date, repo, path, id);","handlingStrategy":"validation","validationCode":"URL u = GhidraURL.toURL(repo);\nif (repo != null && !GhidraURL.isServerRepositoryURL(u) && !GhidraURL.isLocalURL(u)) {\n    throw new IllegalArgumentException(\"repo is not a Ghidra URL: \" + repo);\n}\nman.newExecutableRecord(md5, name, comp, arch, date, repo, path, id);","typeGuard":"boolean isSupportedRepoUrl(String repo) {\n    if (repo == null) return true;\n    URL u = GhidraURL.toURL(repo);\n    return GhidraURL.isServerRepositoryURL(u) || GhidraURL.isLocalURL(u);\n}","tryCatchPattern":"try {\n    man.newExecutableRecord(md5, name, comp, arch, date, repo, path, id);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported repository URL\")) {\n        man.newExecutableRecord(md5, name, comp, arch, date, null, path, id);\n    } else throw e;\n}","preventionTips":["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."],"tags":["bsim","validation","url","repository","java"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}