apache/seatunnel · error · SnmpConnectorException

INVALID_CONFIG

INVALID_CONFIG

Error message

Option `${optionName}` references unknown field `${fieldName}`. Available fields are ${fieldNames}

What it means

The SNMP sink requires that configured options (oid_field, value_field, value_type_field) name an existing field in the row schema. requireStringField looks the field up by name in the SeaTunnelRowType and throws INVALID_CONFIG when indexOf returns negative, listing the valid field names.

Solutions

  1. Set the option value to an exact field name from the sink table schema (see the 'Available fields' list in the message)
  2. Fix typos or case mismatches between the config option and schema field names
  3. Update the sink config after any upstream column rename
  4. Validate the config against the schema in a pre-submit dry run

Example fix

// before
sink {
  SnmpSink {
    oid_field = "oid_col"
  }
}
// after
sink {
  SnmpSink {
    oid_field = "oid"  // matches schema field
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// Java: verify option values against schema before constructing the converter
for (String f : List.of(config.getOidField(), config.getValueField(), config.getValueTypeField())) {
    if (rowType.indexOf(f, false) < 0) {
        throw new IllegalArgumentException("unknown field: " + f
            + "; available: " + Arrays.toString(rowType.getFieldNames()));
    }
}

Try / catch

try {
    new SnmpSinkRowConverter(rowType, config);
} catch (SeaTunnelException e) {
    if (e.getMessage().contains("references unknown field")) {
        LOG.error("SNMP sink config field name mismatch; available fields: "
            + Arrays.toString(rowType.getFieldNames()), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Constructor SnmpSinkRowConverter(...) calls requireStringField(rowType, config.getOidField()/getValueField()/getValueTypeField(), ...) and the configured field name is not present in the sink table's SeaTunnelRowType.

Common situations: Typo in oid_field/value_field option values; renaming a source column without updating the sink config; case-sensitivity mismatches between config and schema; copying example configs without adapting field names.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/sink/SnmpSinkRowConverter.java:97

        if (row.getArity() != rowArity) {
            throw invalidRow(
                    "Input row arity "
                            + row.getArity()
                            + " does not match the configured schema arity "
                            + rowArity);
        }

        String oid = requireNonBlankRowValue(row, oidIndex, "OID");
        String value = requireNonNullRowValue(row, valueIndex, "value");
        String valueType = requireNonBlankRowValue(row, valueTypeIndex, "value type");
        return new SnmpSetRequest(parseOid(oid), parseVariable(valueType, value));
    }

    private static int requireStringField(
            SeaTunnelRowType rowType, String fieldName, String optionName) {
        int index = rowType.indexOf(fieldName, false);
        if (index < 0) {
            throw invalidConfig(
                    "Option `"
                            + optionName
                            + "` references unknown field `"
                            + fieldName
                            + "`. Available fields are "
                            + Arrays.toString(rowType.getFieldNames()));
        }
        SeaTunnelDataType<?> dataType = rowType.getFieldType(index);
        if (dataType.getSqlType() != SqlType.STRING) {
            throw invalidConfig(
                    "Field `"
                            + fieldName
                            + "` configured by `"
                            + optionName
                            + "` must use STRING type, but was "
                            + dataType.getSqlType());
        }
        return index;

View on GitHub (pinned to cf67b549a7)