{"record":{"id":"c8e1f69e61efaec5","repo":"apache/seatunnel","slug":"invalid-config","errorCode":"INVALID_CONFIG","errorMessage":"Field '' not found in source data","messagePattern":"Field '' not found in source data","errorType":"error_code","errorClass":"AerospikeConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeTypeConverter.java","lineNumber":59,"sourceCode":"\n    public AerospikeTypeConverter(SeaTunnelRowType rowType, ReadonlyConfig config) {\n        this.fieldTypeMapping = new HashMap<>();\n        Map<String, String> configFieldTypes = config.get(AerospikeSinkOptions.FIELD_TYPES);\n\n        if (configFieldTypes == null || configFieldTypes.isEmpty()) {\n            String[] allFields = rowType.getFieldNames();\n            this.fieldNames = Arrays.asList(allFields);\n            for (String field : allFields) {\n                int index = rowType.indexOf(field);\n                SeaTunnelDataType<?> seaTunnelType = rowType.getFieldType(index);\n                fieldTypeMapping.put(field, mapSeaTunnelType(seaTunnelType));\n            }\n        } else {\n            this.fieldNames = new ArrayList<>(configFieldTypes.keySet());\n            for (String fieldName : configFieldTypes.keySet()) {\n                int index = rowType.indexOf(fieldName);\n                if (index == -1) {\n                    throw new AerospikeConnectorException(\n                            AerospikeErrorCode.INVALID_CONFIG,\n                            \"Field '\" + fieldName + \"' not found in source data\");\n                }\n                fieldTypeMapping.put(\n                        fieldName, AerospikeDataType.valueOf(configFieldTypes.get(fieldName)));\n            }\n        }\n    }\n\n    private AerospikeDataType mapSeaTunnelType(SeaTunnelDataType<?> seaTunnelType) {\n        switch (seaTunnelType.getSqlType()) {\n            case STRING:\n                return AerospikeDataType.STRING;\n            case INT:\n                return AerospikeDataType.INTEGER;\n            case BIGINT:\n                return AerospikeDataType.LONG;\n            case DOUBLE:","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeTypeConverter.java#L41-L77","documentation":"When the Aerospike sink option 'field_types' is set, AerospikeTypeConverter validates that every listed field actually exists in the SeaTunnelRowType (the schema of the incoming data). If a configured field name has no matching column in the row type (indexOf returns -1), it throws AerospikeConnectorException with code INVALID_CONFIG. This is a startup-time configuration validation that catches schema/config mismatches before any records are written.","triggerScenarios":"Constructing AerospikeTypeConverter(rowType, config) where config's FIELD_TYPES map contains a key that does not match any field name in the row type — typically a typo, a case mismatch (matching is exact), or a field that was removed/renamed upstream.","commonSituations":"Typo in field_types key (e.g. 'user_id' vs 'userId'); renaming a column upstream without updating the sink config; relying on case-insensitive matching that the connector does not do; copying configs between jobs whose schemas differ; the empty string '' key in field_types from a mis-edited HOCON map.","solutions":["Compare each key in the 'field_types' config against the actual field names in your source schema and fix the spelling/case to match exactly.","Remove stale entries in field_types for columns that no longer exist upstream.","Print/inspect the row type (e.g. via the job's schema or a FakeSource/print sink) to confirm the exact field names, then align the config.","If you want all schema fields written automatically, delete the field_types option entirely so the converter derives mappings from the row type."],"exampleFix":"// before\nfield_types = {usr_name = STRING}\n\n// after (schema has 'user_name')\nfield_types = {user_name = STRING}","handlingStrategy":"validation","validationCode":"for (String fieldName : configFieldTypes.keySet()) {\n    if (rowType.indexOf(fieldName) == -1) {\n        throw new IllegalArgumentException(\"field_types key '\" + fieldName\n            + \"' not in schema: \" + java.util.Arrays.toString(rowType.getFieldNames()));\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    new AerospikeTypeConverter(rowType, config);\n} catch (AerospikeConnectorException e) {\n    if (e.getCode() == AerospikeErrorCode.INVALID_CONFIG\n            && e.getMessage().contains(\"not found in source data\")) {\n        // fix field_types keys to match rowType.getFieldNames() and retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Copy field names verbatim from the source schema; matching is exact and case-sensitive.","Diff field_types keys against rowType.getFieldNames() at startup before submitting the job.","After upstream schema changes, update the sink's field_types in the same change.","Omit field_types entirely to auto-map every schema field and avoid name mismatches."],"tags":["aerospike","configuration","schema","field-mapping"],"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"}