{"record":{"id":"785b9faed81330f5","repo":"prestodb/presto","slug":"path-does-not-start-with-a-slash","errorCode":null,"errorMessage":"Path does not start with a slash: ","messagePattern":"Path does not start with a slash: ","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java","lineNumber":398,"sourceCode":"        try {\n            return new URI(scheme, null, address.getHost(), address.getPort(), null, null, null);\n        }\n        catch (URISyntaxException e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    private void initCatalogAndSchema()\n            throws SQLException\n    {\n        String path = uri.getPath();\n        if (isNullOrEmpty(uri.getPath()) || path.equals(\"/\")) {\n            return;\n        }\n\n        // remove first slash\n        if (!path.startsWith(\"/\")) {\n            throw new SQLException(\"Path does not start with a slash: \" + uri);\n        }\n        path = path.substring(1);\n\n        List<String> parts = Splitter.on(\"/\").splitToList(path);\n        // remove last item due to a trailing slash\n        if (parts.get(parts.size() - 1).isEmpty()) {\n            parts = parts.subList(0, parts.size() - 1);\n        }\n\n        if (parts.size() > 2) {\n            throw new SQLException(\"Invalid path segments in URL: \" + uri);\n        }\n\n        if (parts.get(0).isEmpty()) {\n            throw new SQLException(\"Catalog name is empty: \" + uri);\n        }\n        catalog = parts.get(0);\n","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java#L380-L416","documentation":"initCatalogAndSchema parses the catalog/schema from the URL path: if the path is non-empty and does not begin with '/', the URL form is unsupported and this SQLException naming the URI is thrown, ensuring catalog/schema are always expressed as /catalog or /catalog/schema.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the URL path with a leading slash: jdbc:presto://host:port/catalog/schema","Remove any malformed path segment from the JDBC URL"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}