apache/seatunnel · error · CassandraConnectorException

CONFIG_VALIDATION_FAILED

CONFIG_VALIDATION_FAILED

Error message

PluginName: %s, PluginType: %s, Message: %s

What it means

The entire validation block of CassandraSink is wrapped in a catch-all that rethrows any exception as CONFIG_VALIDATION_FAILED with the plugin name, type, and original message. So any error during sink setup (including the FIELD_NOT_IN_TABLE above, or session/connection errors during schema lookup) surfaces under this generic code.

Source

Thrown at seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/sink/CassandraSink.java:85

                List<String> newFields = new ArrayList<>();
                for (int i = 0; i < tableSchema.size(); i++) {
                    newFields.add(tableSchema.get(i).getName().asInternal());
                }
                this.cassandraParameters.setFields(newFields);
            } else {
                for (String field : fields) {
                    if (!tableSchema.contains(field)) {
                        throw new CassandraConnectorException(
                                CassandraConnectorErrorCode.FIELD_NOT_IN_TABLE,
                                "Field "
                                        + field
                                        + " does not exist in table "
                                        + pluginConfig.get(TABLE));
                    }
                }
            }
        } catch (Exception e) {
            throw new CassandraConnectorException(
                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,
                    String.format(
                            "PluginName: %s, PluginType: %s, Message: %s",
                            getPluginName(), PluginType.SINK, ExceptionUtils.getMessage(e)));
        }
    }

    @Override
    public String getPluginName() {
        return "Cassandra";
    }

    @Override
    public AbstractSinkWriter<SeaTunnelRow, Void> createWriter(SinkWriter.Context context)
            throws IOException {
        return new CassandraSinkWriter(
                cassandraParameters, catalogTable.getSeaTunnelRowType(), tableSchema);
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Read the 'Message: ...' portion of the error — it embeds the underlying cause (e.g. field-not-in-table or connection error) and fix that root issue.
  2. Validate Cassandra connectivity and the table/keyspace in config before submitting the job.
  3. Correct the `fields`/`table`/`keyspace` config entries to match the actual Cassandra schema.
  4. Test the same CQL statements with cqlsh using identical credentials to isolate config vs environment problems.

Example fix

// before: connection timeout during validation due to wrong host
hosts = ["localhost:9042"]
// after: point to the actual reachable cluster
hosts = ["cassandra-node1:9042", "cassandra-node2:9042"]
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate plugin config before submit: hosts reachable, keyspace/table exist
nc -z ${HOST} 9042 && cqlsh ${HOST} -e "DESCRIBE KEYSPACE ${KEYSPACE};"

Try / catch

// this code wraps all validation errors — parse the embedded cause
try {
    submit(cfg);
} catch (CassandraConnectorException e) {
    log.error("Plugin validation failed, root cause: {}", e.getMessage(), e);
    throw e;
}

Prevention

When it happens

Trigger: Any exception thrown inside the CassandraSink constructor's try block: schema retrieval failures, connection errors, field validation failures — caught and re-wrapped with "PluginName: %s, PluginType: %s, Message: %s".

Common situations: Misconfigured host/keyspace/table causing schema lookup to fail during plugin validation; invalid field lists; driver initialization problems; the real cause is in ExceptionUtils.getMessage(e) appended to the message.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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