apache/seatunnel · error · IOException

SNMP agent returned error status {errorStatus} ({errorStatus

Error message

SNMP agent returned error status {errorStatus} ({errorStatusText}) at index {errorIndex}

What it means

After a SET exchange completes, Snmp4jSetClient.set() inspects the response PDU's errorStatus. If it is not PDU.noError, the agent explicitly rejected the SET and the client wraps the agent's status code, status text, and error index into this IOException. Unlike a timeout, the agent was reachable but refused the operation.

Source

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

        }
        this.target = createdTarget;
        this.snmp = snmp;
    }

    @Override
    public void set(SnmpSetRequest request) throws IOException {
        ResponseEvent event = snmp.send(buildSetRequest(request), target);
        if (event == null || event.getResponse() == null) {
            throw new IOException(
                    "SNMP SET request timed out for agent "
                            + config.getHost()
                            + ":"
                            + config.getPort());
        }

        PDU response = event.getResponse();
        if (response.getErrorStatus() != PDU.noError) {
            throw new IOException(
                    "SNMP agent returned error status "
                            + response.getErrorStatus()
                            + " ("
                            + response.getErrorStatusText()
                            + ") at index "
                            + response.getErrorIndex());
        }
    }

    @Override
    public void close() throws IOException {
        snmp.close();
    }

    static PDU buildSetRequest(SnmpSetRequest request) {
        PDU pdu = new PDU();
        pdu.setType(PDU.SET);
        pdu.add(new VariableBinding(request.getOid(), request.getValue()));

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Read errorStatusText and errorIndex from the message to identify which OID varbind was rejected.
  2. Confirm the target OID is writable on the agent (not read-only) and exists in the agent's MIB view.
  3. Match the value's ASN.1 type/syntax to the OID's MIB definition (SnmpSinkRowConverter output).
  4. Use a read-write community or SNMPv3 user with write access for SET operations.
  5. Test the same SET manually with snmpset to reproduce the agent's rejection outside SeaTunnel.

Example fix

// before
request OID: 1.3.6.1.2.1.1.4.0 (sysContact) with community "public" (read-only)
// after
use rw-community "private" or SNMPv3 user with write privilege for sysContact
Defensive patterns

Strategy: validation

Validate before calling

// validate the OID is writable and present before the job
String out = snmpCli("snmpget -v2c -c " + community + " " + host + " " + oid);
if (out.contains("No Such Instance")) throw new IllegalArgumentException("OID not on agent: " + oid);
// check MIB definition marks MAX-ACCESS as read-write/read-create

Try / catch

try {
    client.set(request);
} catch (IOException e) {
    PduError pe = parseAgentError(e);
    if (pe != null) throw new InvalidOidMappingException(pe.status, pe.index, request.getOid());
    throw e;
}

Prevention

When it happens

Trigger: Calling Snmp4jSetClient.set(SnmpSetRequest) where the response PDU has getErrorStatus() != PDU.noError (e.g. noSuchName, badValue, genErr, authorizationError), with errorIndex pointing at the offending varbind.

Common situations: Writing to a read-only OID; OID does not exist on the agent (noSuchName); wrong value type/syntax for the OID (badValue); SET with a read-only community (authorizationError); variable bindings built from mismatched SeaTunnel row columns.

Related errors


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