{"record":{"id":"8865d91f7bcaabf9","repo":"apache/seatunnel","slug":"connect-failed","errorCode":"CONNECT_FAILED","errorMessage":"Failed to connect to Databend server: {e.getMessage()}","messagePattern":"Failed to connect to Databend server: (.+?)","errorType":"error_code","errorClass":"DatabendConnectorException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/catalog/DatabendCatalog.java","lineNumber":103,"sourceCode":"\n    @Override\n    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)\n            throws DatabaseNotExistException, CatalogException {\n        String databaseName = tablePath.getDatabaseName();\n        dropDatabase(databaseName, ignoreIfNotExists);\n    }\n\n    @Override\n    public void open() throws CatalogException {\n        if (isOpened) {\n            return;\n        }\n\n        try (Connection connection = getConnection()) {\n            log.info(\"Successfully connected to Databend\");\n            isOpened = true;\n        } catch (SQLException e) {\n            throw new DatabendConnectorException(\n                    DatabendConnectorErrorCode.CONNECT_FAILED,\n                    \"Failed to connect to Databend server: \" + e.getMessage(),\n                    e);\n        }\n    }\n\n    @Override\n    public void close() throws CatalogException {\n        // Databend JDBC connections are closed after use\n        isOpened = false;\n    }\n\n    @Override\n    public String name() {\n        return catalogName;\n    }\n\n    @Override","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/catalog/DatabendCatalog.java#L85-L121","documentation":"DatabendCatalog.open() obtains a JDBC connection via getConnection() and, if a SQLException occurs while establishing it, throws CONNECT_FAILED. The wrapped e.getMessage() carries the driver's actual reason (auth failure, DNS failure, TLS error, etc.). This is thrown when the catalog is opened before any metadata operations run.","triggerScenarios":"Catalog open() calls getConnection() and the driver raises a SQLException: wrong JDBC URL/host/port, unreachable server, invalid username/password, TLS handshake failure, or HTTP proxy issues against the Databend query endpoint (usually port 443/8000).","commonSituations":"Typo in jdbc:databend:// URL, DatabendCloud vs self-hosted endpoint confusion, wrong credentials or missing user creation, network egress blocked from the SeaTunnel worker, or using port 8000 where only 443 is allowed.","solutions":["Read the wrapped SQLException message for the concrete cause and verify the url/username/password options are correct for your Databend deployment.","Test connectivity from the worker host: curl -v https://databend-host:443 or run the same JDBC URL from a standalone Java/client tool.","Confirm the JDBC URL format: jdbc:databend://host:port/database with ssl settings appropriate to the deployment.","Check that the Databend user exists with SQL access from the worker's IP (GRANT statements / IP allowlist on DatabendCloud)."],"exampleFix":"// before\nurl = \"jdbc:databend://localhost:8000\" // wrong port/host, no credentials\n// after\nurl = \"jdbc:databend://databend-host:443/default?ssl=true\"\nusername = \"root\"\npassword = \"password\"","handlingStrategy":"validation","validationCode":"// before opening the catalog\ntry (Connection c = DriverManager.getConnection(url, user, pass)) {\n  System.out.println(\"databend reachable\");\n} catch (SQLException e) {\n  throw new IllegalStateException(\"pre-check failed: \" + e.getMessage());\n}","typeGuard":null,"tryCatchPattern":"try {\n  catalog.open();\n} catch (DatabendConnectorException e) {\n  if (e.getErrorCode() == CONNECT_FAILED) {\n    log.error(\"connection failed: {}\", e.getCause().getMessage());\n    // alert / abort job before doing metadata work\n  }\n}","preventionTips":["Validate the JDBC URL format and port (443 for DatabendCloud TLS, 8000 for query WS) before deploying","Pre-test credentials with a standalone client from the worker host","Check firewall/egress rules from SeaTunnel workers to Databend","Create the Databend user and grants before running the job"],"tags":["databend","jdbc","connection","catalog"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}