{"record":{"id":"c941ca2c40a70784","repo":"prestodb/presto","slug":"invalid-port-number","errorCode":null,"errorMessage":"Invalid port number: ","messagePattern":"Invalid port number: ","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java","lineNumber":372,"sourceCode":"\n    private static URI parseDriverUrl(String url)\n            throws SQLException\n    {\n        URI uri;\n        try {\n            uri = new URI(url.substring(JDBC_URL_START.length()));\n        }\n        catch (URISyntaxException e) {\n            throw new SQLException(\"Invalid JDBC URL: \" + url, e);\n        }\n        if (isNullOrEmpty(uri.getHost())) {\n            throw new SQLException(\"No host specified: \" + url);\n        }\n        if (uri.getPort() == -1) {\n            throw new SQLException(\"No port number specified: \" + url);\n        }\n        if ((uri.getPort() < 1) || (uri.getPort() > 65535)) {\n            throw new SQLException(\"Invalid port number: \" + url);\n        }\n        return uri;\n    }\n\n    private URI buildHttpUri()\n    {\n        String scheme = useSecureConnection ? \"https\" : \"http\";\n        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    {","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java#L354-L390","documentation":"Port validation in parseDriverUrl: the URI parsed from the JDBC URL contains a port outside the valid range (less than 1 or greater than 65535). The offending URL is appended; this catches mistyped ports like 0, negative values, or values overflows.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid port number (1-65535) in the JDBC URL","Verify against the coordinator's actual configured port"],"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"}