apache/seatunnel · error · SnmpConnectorException

WRITE_FAILED

WRITE_FAILED

Error message

Failed to set OID {oid} on SNMP agent {host}:{port}

What it means

SnmpSinkWriter.write() converts each SeaTunnelRow into a SnmpSetRequest and delegates to client.set(). Any IOException from the SET exchange (timeout or agent error) is rethrown as SnmpConnectorException with WRITE_FAILED, attaching the OID and agent address. This fails the write and, depending on engine semantics, the task.

Source

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

            this.client = clientFactory.create(config);
        } catch (IOException e) {
            throw new SnmpConnectorException(
                    SnmpConnectorErrorCode.CONNECTION_FAILED,
                    "Failed to initialize SNMP SET client for agent "
                            + config.getHost()
                            + ":"
                            + config.getPort(),
                    e);
        }
    }

    @Override
    public void write(SeaTunnelRow row) {
        SnmpSetRequest request = converter.convert(row);
        try {
            client.set(request);
        } catch (IOException e) {
            throw new SnmpConnectorException(
                    SnmpConnectorErrorCode.WRITE_FAILED,
                    "Failed to set OID "
                            + request.getOid()
                            + " on SNMP agent "
                            + config.getHost()
                            + ":"
                            + config.getPort(),
                    e);
        }
    }

    @Override
    public void close() {
        try {
            client.close();
        } catch (IOException e) {
            throw new SnmpConnectorException(
                    SnmpConnectorErrorCode.CLOSE_FAILED,

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the wrapped cause: timeout means connectivity/timeout tuning, error status means OID/type/ACL problem.
  2. Verify the row-to-OID mapping in SnmpSinkConfig matches the agent's MIB (types and instance OIDs).
  3. Confirm the agent is up and reachable from the SeaTunnel worker for the job's lifetime.
  4. Use a read-write community/SNMPv3 write user.
  5. Enable connector retry/checkpointing so transient SNMP timeouts do not kill the job.

Example fix

// before
write to OID 1.3.6.1.4.1.9999.1.2 with value "abc" but OID expects Integer32
// after
SnmpSinkConfig mapping: column type INTEGER -> OID 1.3.6.1.4.1.9999.1.2 (Integer32 syntax)
Defensive patterns

Strategy: try-catch

Validate before calling

// before the job: verify the exact SET succeeds once outside the pipeline
snmpset -v2c -c <rw-community> <host> <oid> <test-value>

Try / catch

try {
    writer.write(row);
} catch (SnmpConnectorException e) {
    if (e.getCode() == SnmpConnectorErrorCode.WRITE_FAILED && isTransient(e.getCause())) {
        retryWrite(row);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling write(SeaTunnelRow) where converter.convert(row) produced a valid request but client.set() threw IOException — SNMP timeout (see 2410) or agent error status (see 2411).

Common situations: Row column values incompatible with the OID's MIB syntax; agent went down mid-job; network flakiness between worker and agent; read-only community used for the whole job.

Related errors


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