apache/seatunnel · critical · S3RedshiftJdbcConnectorException

SQL_OPERATION_FAILED

SQL_OPERATION_FAILED

Error message

RedshiftJdbcClient init error

What it means

RedshiftJdbcClient.getInstance builds the singleton JDBC connection using url/user/password from the sink config. Any SQLException (connection failure, bad credentials) or ClassNotFoundException (Redshift JDBC driver missing on the classpath) is wrapped as S3RedshiftJdbcConnectorException(SQL_OPERATION_FAILED, "RedshiftJdbcClient init error").

Source

Thrown at seatunnel-connectors-v2/connector-s3-redshift/src/main/java/org/apache/seatunnel/connectors/seatunnel/redshift/RedshiftJdbcClient.java:51

    private static volatile RedshiftJdbcClient INSTANCE = null;

    private final Connection connection;

    public static RedshiftJdbcClient getInstance(ReadonlyConfig config)
            throws S3RedshiftJdbcConnectorException {
        if (INSTANCE == null) {
            synchronized (RedshiftJdbcClient.class) {
                if (INSTANCE == null) {

                    try {
                        INSTANCE =
                                new RedshiftJdbcClient(
                                        config.get(S3RedshiftSinkOptions.JDBC_URL),
                                        config.get(S3RedshiftSinkOptions.JDBC_USER),
                                        config.get(S3RedshiftSinkOptions.JDBC_PASSWORD));
                    } catch (SQLException | ClassNotFoundException e) {
                        throw new S3RedshiftJdbcConnectorException(
                                CommonErrorCodeDeprecated.SQL_OPERATION_FAILED,
                                "RedshiftJdbcClient init error",
                                e);
                    }
                }
            }
        }
        return INSTANCE;
    }

    private RedshiftJdbcClient(String url, String user, String password)
            throws SQLException, ClassNotFoundException {
        Class.forName("com.amazon.redshift.jdbc42.Driver");
        this.connection = DriverManager.getConnection(url, user, password);
    }

    public boolean checkTableExists(String tableName) {
        boolean flag = false;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify jdbc_url, jdbc_user and jdbc_password in the sink config and test connectivity (nc/telnet to the Redshift endpoint:5439)
  2. Ensure the Redshift JDBC driver jar is installed under the connector's plugin directory
  3. Check the cause chain of the exception to distinguish ClassNotFoundException (driver missing) from SQLException (network/auth)

Example fix

// before
jdbc_url = "jdbc:redshift://wrong-host:5439/dev"
// after
jdbc_url = "jdbc:redshift://examplecluster.abc123xyz.us-west-2.redshift.amazonaws.com:5439/dev"
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight connectivity check before the job
try (Connection c = DriverManager.getConnection(jdbcUrl, user, password)) {
    System.out.println("redshift ok");
}

Try / catch

try {
    RedshiftJdbcClient.getInstance(config);
} catch (S3RedshiftJdbcConnectorException e) {
    Throwable cause = e.getCause();
    if (cause instanceof ClassNotFoundException) { /* install driver jar */ }
    else if (cause instanceof SQLException) { /* check url/credentials/network */ }
}

Prevention

When it happens

Trigger: Calling getInstance with JDBC_URL unreachable, wrong JDBC_USER/JDBC_PASSWORD, or the Redshift JDBC driver class not found at static-initialization time.

Common situations: VPC/security-group blocking the Redshift port, IAM-auth password rotation, missing driver jar in the SeaTunnel plugin directory, or a malformed jdbc:redshift:// URL.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/1ae201e46042d210. Report an issue: GitHub.