prestodb/presto · error · SQLException

Path does not start with a slash:

Error message

Path does not start with a slash: 

What it means

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.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:398

        try {
            return new URI(scheme, null, address.getHost(), address.getPort(), null, null, null);
        }
        catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }

    private void initCatalogAndSchema()
            throws SQLException
    {
        String path = uri.getPath();
        if (isNullOrEmpty(uri.getPath()) || path.equals("/")) {
            return;
        }

        // remove first slash
        if (!path.startsWith("/")) {
            throw new SQLException("Path does not start with a slash: " + uri);
        }
        path = path.substring(1);

        List<String> parts = Splitter.on("/").splitToList(path);
        // remove last item due to a trailing slash
        if (parts.get(parts.size() - 1).isEmpty()) {
            parts = parts.subList(0, parts.size() - 1);
        }

        if (parts.size() > 2) {
            throw new SQLException("Invalid path segments in URL: " + uri);
        }

        if (parts.get(0).isEmpty()) {
            throw new SQLException("Catalog name is empty: " + uri);
        }
        catalog = parts.get(0);

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Write the URL path with a leading slash: jdbc:presto://host:port/catalog/schema
  2. Remove any malformed path segment from the JDBC URL
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:398 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/785b9faed81330f5. Report an issue: GitHub.