{"record":{"id":"fd69f883b22188a4","repo":"NationalSecurityAgency/ghidra","slug":"remote-file-url-not-supported","errorCode":null,"errorMessage":"Remote file URL not supported: {}","messagePattern":"Remote file URL not supported: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java","lineNumber":188,"sourceCode":"\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_POSTGRES_PORT : p;\n\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(\"/\")) {","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimServerInfo.java#L170-L206","documentation":"Thrown by the BSimServerInfo(URL) constructor when the protocol is file but the URL has a non-empty host component. BSim file databases are strictly local H2 files; a remote host in a file:// URL (e.g. file://server/share/db.mv.db) is unsupported. Throws IllegalArgumentException.","triggerScenarios":"Constructing BSimServerInfo from a URL like 'file://nas/share/bsim.mv.db' where url.getHost() is non-empty.","commonSituations":"Pointing a file:// URL at a network share or remote machine; misinterpreting a UNC path as a supported file DB location.","solutions":["Use a local file:// URL with an empty host, e.g. 'file:/opt/bsim/data.mv.db'.","If the database is remote, switch to a postgres or elastic protocol instead.","Mount the network share locally and reference the mount point as a local path."],"exampleFix":"// before\nnew BSimServerInfo(new URL(\"file://nas/share/bsim.mv.db\"));\n// after (local path, empty host)\nnew BSimServerInfo(new URL(\"file:/mnt/nas/share/bsim.mv.db\"));","handlingStrategy":"validation","validationCode":"URL u = ...;\nif (u.getProtocol().startsWith(\"file\") && !\"\".equals(u.getHost())) {\n    throw new IllegalArgumentException(\"BSim file DBs must be local; URL has host: \" + u.getHost());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use local file: URLs with an empty host for file databases.","For remote databases, choose postgresql:// or https:// instead.","Mount network shares locally and reference the mount point as a local path."],"tags":["bsim","validation","database-url","h2"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}