{"record":{"id":"438f2ae1e78ba833","repo":"apache/seatunnel","slug":"snmp-set-request-timed-out-for-agent-host-port","errorCode":null,"errorMessage":"SNMP SET request timed out for agent {host}:{port}","messagePattern":"SNMP SET request timed out for agent (.+?):(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/sink/Snmp4jSetClient.java","lineNumber":65,"sourceCode":"            createdTarget = SnmpTargetFactory.create(config);\n            snmp.listen();\n        } catch (IOException | RuntimeException e) {\n            try {\n                snmp.close();\n            } catch (IOException closeException) {\n                e.addSuppressed(closeException);\n            }\n            throw e;\n        }\n        this.target = createdTarget;\n        this.snmp = snmp;\n    }\n\n    @Override\n    public void set(SnmpSetRequest request) throws IOException {\n        ResponseEvent event = snmp.send(buildSetRequest(request), target);\n        if (event == null || event.getResponse() == null) {\n            throw new IOException(\n                    \"SNMP SET request timed out for agent \"\n                            + config.getHost()\n                            + \":\"\n                            + config.getPort());\n        }\n\n        PDU response = event.getResponse();\n        if (response.getErrorStatus() != PDU.noError) {\n            throw new IOException(\n                    \"SNMP agent returned error status \"\n                            + response.getErrorStatus()\n                            + \" (\"\n                            + response.getErrorStatusText()\n                            + \") at index \"\n                            + response.getErrorIndex());\n        }\n    }\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/sink/Snmp4jSetClient.java#L47-L83","documentation":"Snmp4jSetClient.set() sends an SNMP SET PDU to the configured agent and waits for a ResponseEvent. If the event or its response is null, SNMP4J gave up waiting for a reply (timeout or transport failure), so the client cannot confirm the write and throws this IOException. It signals the agent was unreachable or did not answer within the retry/timeout window.","triggerScenarios":"Calling Snmp4jSetClient.set(SnmpSetRequest) when snmp.send() returns null (transport error) or a ResponseEvent with getResponse()==null (request timed out after retries) for agent host:port.","commonSituations":"Wrong agent host/port in config; SNMP agent down or firewall dropping UDP 161; community string accepted but agent silently discards SET; SNMPv3 credentials wrong so agent ignores requests; timeout/retry config too aggressive for a slow agent.","solutions":["Verify config.getHost()/config.getPort() point at a reachable SNMP agent (ping, telnet/nc on UDP 161).","Confirm the community string / SNMPv3 USM credentials and security level match the agent; agents silently drop unauthorized SETs.","Increase SNMP timeout and retries in the target built from SnmpSinkConfig so slow agents can respond.","Check agent-side ACLs (snmpd rocommunity/rwcommunity, view rules) to ensure SET is permitted, not just GET.","Capture traffic with tcpdump/wireshark to confirm the request leaves and whether a response returns."],"exampleFix":"// before\nSnmpSinkConfig config = SnmpSinkConfig.of(\"10.0.0.5\", 161, \"public\", 500, 1);\n// after\nSnmpSinkConfig config = SnmpSinkConfig.of(\"10.0.0.5\", 161, \"private-write-community\", 5000, 3);","handlingStrategy":"retry","validationCode":"// pre-check reachability of the SNMP agent (UDP 161)\nInetAddress addr = InetAddress.getByName(config.getHost());\nif (addr == null) throw new IllegalArgumentException(\"Unresolvable SNMP host: \" + config.getHost());\n// verify a GET works before attempting SET\nsnmpGetProbe(config.getHost(), config.getPort(), config.getCommunity(), 5000);","typeGuard":null,"tryCatchPattern":"try {\n    client.set(request);\n} catch (IOException e) {\n    if (isTimeout(e)) retryWithBackoff(request, 3);\n    else throw new JobExecutionException(\"SNMP SET aborted: \" + config.getHost(), e);\n}","preventionTips":["Always probe with an SNMP GET before running a SET-based job.","Use generous timeout/retry values in SnmpSinkConfig for WAN links.","Verify write (rw) community or SNMPv3 write access during environment setup.","Keep jobs checkpointed so transient SNMP timeouts can be retried."],"tags":["snmp","network","timeout","sink"],"backgroundTag":"request-timeout","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"}