{"record":{"id":"c5561fa3b4ff8565","repo":"NationalSecurityAgency/ghidra","slug":"unsupported-bsim-url-protocol","errorCode":null,"errorMessage":"Unsupported BSim URL protocol: {}","messagePattern":"Unsupported BSim URL protocol: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java","lineNumber":192,"sourceCode":"\t\t}\n\t\telse if (protocol.equals(\"https\") || protocol.equals(\"elastic\")) {\n\t\t\tt = DBType.elastic;\n\t\t\thost = checkURLField(url.getHost(), \"host\");\n\t\t\tuserinfo = getURLUserInfo(url);\n\t\t\tint p = url.getPort();\n\t\t\tport = p <= 0 ? DEFAULT_ELASTIC_PORT : p;\n\t\t}\n\t\telse if (protocol.startsWith(\"file\")) {\n\t\t\tt = DBType.file;\n\t\t\thost = null;\n\t\t\tuserinfo = null;\n\t\t\tport = -1;\n\t\t\tif (!\"\".equals(url.getHost())) {\n\t\t\t\tthrow new IllegalArgumentException(\"Remote file URL not supported: \" + url);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Unsupported BSim URL protocol: \" + protocol);\n\t\t}\n\t\tdbType = t;\n\n\t\tif (dbType == DBType.postgres || dbType == DBType.elastic) {\n\t\t\tif (!path.startsWith(\"/\")) {\n\t\t\t\tthrow new IllegalArgumentException(\"Missing dbName in URL: \" + url);\n\t\t\t}\n\t\t\tpath = path.substring(1).strip();\n\t\t}\n\t\tpath = urlDecode(checkURLField(path, \"path\"));\n\t\tif (dbType == DBType.file) {\n\t\t\tpath = cleanupFilename(path);\n\t\t}\n\t\telse if (path.contains(\"/\")) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid dbName in URL: \" + path);\n\t\t}\n\t\tdbName = path;\n\t}","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java#L174-L210","documentation":"Thrown by the BSimServerInfo(URL) constructor when the URL protocol is none of 'postgresql', 'https', 'elastic', or a 'file'-prefixed scheme. BSim only recognizes those four protocol families. Throws IllegalArgumentException.","triggerScenarios":"Constructing BSimServerInfo from a URL with an unsupported scheme, e.g. 'mysql://host/db' or 'http://host/db' (note: http is not accepted, only https/elastic).","commonSituations":"Using a JDBC-style URL or a non-BSim protocol; typo in the scheme; confusing BSim URLs with standard database connection URLs.","solutions":["Use one of the supported protocols: postgresql://, https://, elastic://, or file:.","If targeting Elasticsearch, use 'https://' or 'elastic://' (not 'http://').","Verify the URL scheme matches the actual BSim backend type."],"exampleFix":"// before\nnew BSimServerInfo(new URL(\"http://host:9200/bsim\"));\n// after (https for elastic)\nnew BSimServerInfo(new URL(\"https://host:9200/bsim\"));","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"postgresql\",\"https\",\"elastic\");\nString proto = url.getProtocol();\nif (!supported.contains(proto) && !proto.startsWith(\"file\")) {\n    throw new IllegalArgumentException(\"Unsupported BSim URL protocol: \" + proto);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict BSim URLs to postgresql://, https://, elastic://, or file: schemes.","Use https:// (not http://) for Elasticsearch backends.","Validate the protocol against the supported set before constructing."],"tags":["bsim","validation","database-url"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}