{"record":{"id":"97bb4032821494d1","repo":"apache/seatunnel","slug":"snmp-agent-returned-error-status-errorstatus-e-97bb40","errorCode":null,"errorMessage":"SNMP agent returned error status {errorStatus} ({errorStatusText}) at index {errorIndex}","messagePattern":"SNMP agent returned error status (.+?) \\((.+?)\\) at index (.+?)","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":76,"sourceCode":"            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    }\n\n    @Override\n    public void close() throws IOException {\n        snmp.close();\n    }\n\n    static PDU buildGetRequest(List<OID> oids) {\n        PDU pdu = new PDU();\n        pdu.setType(PDU.GET);","sourceCodeStart":58,"sourceCodeEnd":94,"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#L58-L94","documentation":"Snmp4jClient.get() checks the GET response PDU's errorStatus. Any status other than PDU.noError is rethrown as this IOException with the numeric status, text, and varbind index. The agent responded but refused or could not satisfy the GET for at least one OID.","triggerScenarios":"Calling get(List<OID>) where the response has getErrorStatus() != PDU.noError — e.g. noSuchName for a nonexistent OID, tooBig for an oversized PDU, genErr inside the agent.","commonSituations":"OIDs in the source config not present on that agent; requesting OIDs from the wrong MIB version (v1 noSuchName vs v2 noSuchInstance); PDU too big for the agent's max message size; agent internal errors under load.","solutions":["Identify the failing varbind from errorIndex and verify that OID exists on the agent (snmpwalk).","Use SNMPv2c/v3 instead of v1 to get noSuchInstance/noSuchObject instead of blunt noSuchName failures.","If errorStatus is tooBig, request fewer OIDs per GET.","Confirm the community has read access to that subtree of the MIB.","Cross-check OIDs in the config against the agent's actual MIB (vendor MIB files)."],"exampleFix":"// before\noids = [1.3.6.1.2.1.1.1.0, 1.3.6.1.4.1.9999.99.1.0] // second OID absent on agent\n// after\nsnmpwalk to confirm; keep only 1.3.6.1.2.1.1.1.0 or install/point to correct vendor MIB OID","handlingStrategy":"validation","validationCode":"// validate all configured OIDs exist on the agent before the job\nfor (String oid : config.getOids()) {\n    String out = snmpCli(\"snmpget -v2c -c \" + community + \" \" + host + \" \" + oid);\n    if (out.contains(\"No Such\")) throw new IllegalArgumentException(\"OID missing on agent: \" + oid);\n}","typeGuard":null,"tryCatchPattern":"try {\n    records = client.get(oids);\n} catch (IOException e) {\n    AgentError ae = parseAgentStatus(e);\n    if (ae != null && ae.status == PDU.tooBig) shrinkBatchAndRetry(oids);\n    else throw e;\n}","preventionTips":["snmpwalk the configured subtree once to confirm every OID exists.","Prefer SNMPv2c/v3 over v1 for meaningful missing-OID error codes.","Keep the OID list modest to avoid tooBig responses.","Confirm read (ro) community grants access to the configured MIB subtree."],"tags":["snmp","agent-error","read","source"],"backgroundTag":"api-error-response","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"}