{"record":{"id":"c337706e71cae48f","repo":"apache/seatunnel","slug":"config-validation-failed","errorCode":"CONFIG_VALIDATION_FAILED","errorMessage":"PluginName: %s, PluginType: %s, Message: %s","messagePattern":"PluginName: (.+?), PluginType: (.+?), Message: (.+?)","errorType":"error_code","errorClass":"CassandraConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/sink/CassandraSink.java","lineNumber":85,"sourceCode":"                List<String> newFields = new ArrayList<>();\n                for (int i = 0; i < tableSchema.size(); i++) {\n                    newFields.add(tableSchema.get(i).getName().asInternal());\n                }\n                this.cassandraParameters.setFields(newFields);\n            } else {\n                for (String field : fields) {\n                    if (!tableSchema.contains(field)) {\n                        throw new CassandraConnectorException(\n                                CassandraConnectorErrorCode.FIELD_NOT_IN_TABLE,\n                                \"Field \"\n                                        + field\n                                        + \" does not exist in table \"\n                                        + pluginConfig.get(TABLE));\n                    }\n                }\n            }\n        } catch (Exception e) {\n            throw new CassandraConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"PluginName: %s, PluginType: %s, Message: %s\",\n                            getPluginName(), PluginType.SINK, ExceptionUtils.getMessage(e)));\n        }\n    }\n\n    @Override\n    public String getPluginName() {\n        return \"Cassandra\";\n    }\n\n    @Override\n    public AbstractSinkWriter<SeaTunnelRow, Void> createWriter(SinkWriter.Context context)\n            throws IOException {\n        return new CassandraSinkWriter(\n                cassandraParameters, catalogTable.getSeaTunnelRowType(), tableSchema);\n    }","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/sink/CassandraSink.java#L67-L103","documentation":"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.","triggerScenarios":"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\".","commonSituations":"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.","solutions":["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.","Validate Cassandra connectivity and the table/keyspace in config before submitting the job.","Correct the `fields`/`table`/`keyspace` config entries to match the actual Cassandra schema.","Test the same CQL statements with cqlsh using identical credentials to isolate config vs environment problems."],"exampleFix":"// before: connection timeout during validation due to wrong host\nhosts = [\"localhost:9042\"]\n// after: point to the actual reachable cluster\nhosts = [\"cassandra-node1:9042\", \"cassandra-node2:9042\"]","handlingStrategy":"try-catch","validationCode":"// pre-validate plugin config before submit: hosts reachable, keyspace/table exist\nnc -z ${HOST} 9042 && cqlsh ${HOST} -e \"DESCRIBE KEYSPACE ${KEYSPACE};\"","typeGuard":null,"tryCatchPattern":"// this code wraps all validation errors — parse the embedded cause\ntry {\n    submit(cfg);\n} catch (CassandraConnectorException e) {\n    log.error(\"Plugin validation failed, root cause: {}\", e.getMessage(), e);\n    throw e;\n}","preventionTips":["Read the 'Message:' suffix — it contains the real cause.","Pre-validate Cassandra host/keyspace/table/fields before job submission.","Keep configs generated from a single validated source of truth."],"tags":["cassandra","configuration","validation"],"backgroundTag":"invalid-config-value","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"}