{"record":{"id":"141dd5bcea5425cd","repo":"apache/seatunnel","slug":"snmp-request-timed-out-for-agent-host-port","errorCode":null,"errorMessage":"SNMP request timed out for agent {host}:{port}","messagePattern":"SNMP 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/source/Snmp4jClient.java","lineNumber":67,"sourceCode":"        this.target = buildTarget(config);\n        try {\n            snmp.listen();\n        } catch (IOException e) {\n            try {\n                snmp.close();\n            } catch (IOException closeException) {\n                e.addSuppressed(closeException);\n            }\n            throw e;\n        }\n        this.snmp = snmp;\n    }\n\n    @Override\n    public List<SnmpRecord> get(List<OID> oids) throws IOException {\n        ResponseEvent event = snmp.send(buildGetRequest(oids), target);\n        if (event == null || event.getResponse() == null) {\n            throw new IOException(\n                    \"SNMP 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        return extractRecords(response);\n    }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/source/Snmp4jClient.java#L49-L85","documentation":"Snmp4jClient.get() issues an SNMP GET for the configured OIDs. If snmp.send() returns null or a ResponseEvent with a null response, the agent did not answer within the timeout/retries and this IOException is thrown. It means the poll could not be completed, not that the OIDs are missing.","triggerScenarios":"Calling get(List<OID>) when the GET PDU times out (event==null or event.getResponse()==null) against agent host:port.","commonSituations":"Agent offline or wrong IP/port in source config; firewall blocks UDP 161 from the worker; community string wrong (agent drops silently); timeout too short for large OID batches or busy agents; IPv6/IPv4 mismatch.","solutions":["Verify host/port and test manually: snmpget -v2c -c <community> <host> <oid>.","Correct the community string/SNMPv3 credentials — agents silently discard unauthorized GETs.","Raise timeout and retry counts in the target built from the source config.","Check network path (firewall, routing) from the SeaTunnel worker to the agent.","Reduce OID batch size if the agent struggles with large GET PDUs."],"exampleFix":"// before\ntimeout = 500ms, retries = 1 on a WAN link\n// after\ntimeout = 5000ms, retries = 3 in SnmpSourceConfig target settings","handlingStrategy":"retry","validationCode":"// pre-flight probe before the source starts\nString out = snmpCli(\"snmpget -v2c -c \" + community + \" -t 5 -r 3 \" + host + \" \" + firstOid);\nif (out == null || out.isEmpty()) throw new IllegalStateException(\"SNMP agent not answering\");","typeGuard":null,"tryCatchPattern":"try {\n    records = client.get(oids);\n} catch (IOException e) {\n    if (attempt < MAX_RETRIES) { backoff(); retry(); } else throw new SourceUnavailableException(host, e);\n}","preventionTips":["Verify agent reachability with the snmpget CLI from the worker node.","Set timeout/retries appropriate to network latency and agent load.","Correct community strings — silent drops look identical to timeouts.","Monitor packet loss on the path; UDP-based SNMP has no transport retries beyond SNMP4J's."],"tags":["snmp","network","timeout","source"],"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"}