{"record":{"id":"5bd8510904949af5","repo":"apache/seatunnel","slug":"connect-failed-5bd851","errorCode":"CONNECT_FAILED","errorMessage":"Failed to connect to Databend: {e.getMessage()}","messagePattern":"Failed to connect to Databend: (.+?)","errorType":"error_code","errorClass":"DatabendConnectorException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/sink/DatabendSink.java","lineNumber":165,"sourceCode":"            @NonNull SinkWriter.Context context) throws IOException {\n        try {\n            Connection connection = DatabendUtil.createConnection(databendSinkConfig);\n            connection.setAutoCommit(autoCommit);\n\n            return new DatabendSinkWriter(\n                    context,\n                    connection,\n                    catalogTable,\n                    databendSinkConfig,\n                    customSql,\n                    database,\n                    table,\n                    rawTableName,\n                    streamName,\n                    batchSize,\n                    executeTimeoutSec);\n        } catch (SQLException e) {\n            throw new DatabendConnectorException(\n                    DatabendConnectorErrorCode.CONNECT_FAILED,\n                    \"Failed to connect to Databend: \" + e.getMessage(),\n                    e);\n        }\n    }\n\n    @Override\n    public Optional<SaveModeHandler> getSaveModeHandler() {\n        try {\n            // create table path\n            TablePath tablePath = TablePath.of(database, table);\n\n            // create DatabendCatalog\n            DatabendCatalog databendCatalog =\n                    new DatabendCatalog(readonlyConfig, DatabendCatalogFactory.IDENTIFIER);\n\n            // return SaveModeHandler\n            return Optional.of(","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/sink/DatabendSink.java#L147-L183","documentation":"DatabendSink.createWriter failed to establish the JDBC connection/prepare sink resources needed by the writer. The SQLException from connecting to Databend is wrapped with code CONNECT_FAILED. No writer is created and the task fails at initialization.","triggerScenarios":"createWriter calling DatabendUtil to connect (and optionally create the raw table/stream for CDC) and receiving a SQLException — wrong URL/host/port, bad credentials, unreachable server, or invalid database.","commonSituations":"Misconfigured url/username/password in the sink options; Databend behind a firewall or wrong port; database name typo; SSL requirements not met.","solutions":["Verify url, username, password and database in the sink config; test with a JDBC client","Check network reachability (host, port 8000/443, firewalls) to Databend","Confirm the database/table names exist or auto-create is properly configured","Review the cause exception for auth vs. connection failures"],"exampleFix":"// before\nurl = \"databend://db-host:8000\"\n// after (correct scheme/port and credentials)\nurl = \"jdbc:databend://db-host:443?ssl=true\"\nusername = \"default\"\npassword = \"****\"","handlingStrategy":"retry","validationCode":"// pre-check connectivity\ntry (Connection c = DriverManager.getConnection(url, user, pass)) {\n    c.isValid(5);\n}","typeGuard":null,"tryCatchPattern":"try {\n    sink.createWriter(context);\n} catch (DatabendConnectorException e) {\n    if (e.getErrorCode() == DatabendConnectorErrorCode.CONNECT_FAILED) {\n        // backoff and retry, or fail fast with a clear config error\n    } else { throw e; }\n}","preventionTips":["Validate url/username/password with a JDBC client before submitting the job","Confirm host/port reachability from all worker nodes","Keep Databend credentials in centralized, verified config"],"tags":["databend","jdbc","connection","sink"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}