{"record":{"id":"d00c9b6d452bf32e","repo":"apache/seatunnel","slug":"write-failed-d00c9b","errorCode":"WRITE_FAILED","errorMessage":"Failed to set OID {oid} on SNMP agent {host}:{port}","messagePattern":"Failed to set OID (.+?) on SNMP agent (.+?):(.+?)","errorType":"error_code","errorClass":"SnmpConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/sink/SnmpSinkWriter.java","lineNumber":63,"sourceCode":"            this.client = clientFactory.create(config);\n        } catch (IOException e) {\n            throw new SnmpConnectorException(\n                    SnmpConnectorErrorCode.CONNECTION_FAILED,\n                    \"Failed to initialize SNMP SET client for agent \"\n                            + config.getHost()\n                            + \":\"\n                            + config.getPort(),\n                    e);\n        }\n    }\n\n    @Override\n    public void write(SeaTunnelRow row) {\n        SnmpSetRequest request = converter.convert(row);\n        try {\n            client.set(request);\n        } catch (IOException e) {\n            throw new SnmpConnectorException(\n                    SnmpConnectorErrorCode.WRITE_FAILED,\n                    \"Failed to set OID \"\n                            + request.getOid()\n                            + \" on SNMP agent \"\n                            + config.getHost()\n                            + \":\"\n                            + config.getPort(),\n                    e);\n        }\n    }\n\n    @Override\n    public void close() {\n        try {\n            client.close();\n        } catch (IOException e) {\n            throw new SnmpConnectorException(\n                    SnmpConnectorErrorCode.CLOSE_FAILED,","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/sink/SnmpSinkWriter.java#L45-L81","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check the wrapped cause: timeout means connectivity/timeout tuning, error status means OID/type/ACL problem.","Verify the row-to-OID mapping in SnmpSinkConfig matches the agent's MIB (types and instance OIDs).","Confirm the agent is up and reachable from the SeaTunnel worker for the job's lifetime.","Use a read-write community/SNMPv3 write user.","Enable connector retry/checkpointing so transient SNMP timeouts do not kill the job."],"exampleFix":"// before\nwrite to OID 1.3.6.1.4.1.9999.1.2 with value \"abc\" but OID expects Integer32\n// after\nSnmpSinkConfig mapping: column type INTEGER -> OID 1.3.6.1.4.1.9999.1.2 (Integer32 syntax)","handlingStrategy":"try-catch","validationCode":"// before the job: verify the exact SET succeeds once outside the pipeline\nsnmpset -v2c -c <rw-community> <host> <oid> <test-value>","typeGuard":null,"tryCatchPattern":"try {\n    writer.write(row);\n} catch (SnmpConnectorException e) {\n    if (e.getCode() == SnmpConnectorErrorCode.WRITE_FAILED && isTransient(e.getCause())) {\n        retryWrite(row);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Dry-run one record per OID mapping before full job execution.","Ensure agent uptime/monitoring covers the job window.","Use write-enabled credentials for the whole job.","Rely on checkpoint/restart semantics to absorb transient write failures."],"tags":["snmp","write","sink","row-conversion"],"backgroundTag":"database-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}