{"record":{"id":"01ed6794bd9d0148","repo":"apache/seatunnel","slug":"snmp-source-oids-must-contain-only-numeric-oids","errorCode":null,"errorMessage":"SNMP source oids must contain only numeric OIDs: ${configuredOid}","messagePattern":"SNMP source oids must contain only numeric OIDs: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/config/SnmpSourceConfig.java","lineNumber":111,"sourceCode":"        return port;\n    }\n\n    @Override\n    public String getCommunity() {\n        return community;\n    }\n\n    private static List<OID> parseOids(List<String> configuredOids) {\n        if (configuredOids == null || configuredOids.isEmpty()) {\n            throw new IllegalArgumentException(\"SNMP source oids must not be empty\");\n        }\n\n        List<OID> parsed = new ArrayList<>(configuredOids.size());\n        Set<String> unique = new LinkedHashSet<>();\n        for (String configuredOid : configuredOids) {\n            String value = configuredOid == null ? null : configuredOid.trim();\n            if (value == null || !NUMERIC_OID.matcher(value).matches()) {\n                throw new IllegalArgumentException(\n                        \"SNMP source oids must contain only numeric OIDs: \" + configuredOid);\n            }\n            if (value.charAt(0) == '.') {\n                value = value.substring(1);\n            }\n            OID oid;\n            try {\n                oid = new OID(value);\n            } catch (RuntimeException e) {\n                throw new IllegalArgumentException(\"Invalid SNMP source OID: \" + value, e);\n            }\n            String normalized = oid.toString();\n            if (!unique.add(normalized)) {\n                throw new IllegalArgumentException(\"Duplicate SNMP source OID: \" + normalized);\n            }\n            parsed.add(oid);\n        }\n        return Collections.unmodifiableList(parsed);","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/config/SnmpSourceConfig.java#L93-L129","documentation":"parseOids() validates each configured OID against a NUMERIC_OID regex and throws when any entry is null or not a purely numeric dotted OID string. Only numeric form (e.g. '1.3.6.1.2.1.1.3.0') is accepted; symbolic names like 'sysUpTime.0' require an SNMP MIB resolver this connector does not perform.","triggerScenarios":"SnmpSourceConfig constructor -> parseOids(); fires when any element of the oids list is null or fails the numeric OID pattern — e.g. oids = [\"sysUpTime.0\"], [\"1.3.6.1..2\"], or a list containing a null element.","commonSituations":"Using human-readable MIB names copied from vendor documentation or an MIB browser in 'name' mode; trailing/leading dots or double dots; nulls injected by programmatic config generation.","solutions":["Replace symbolic names with their numeric dotted equivalents (resolve via an MIB browser or `snmptranslate -On sysUpTime.0` -> 1.3.6.1.2.1.1.3.0)","Remove leading '.' and fix malformed dotted strings (no empty segments)","Filter null/blank entries out of the list before passing the config"],"exampleFix":"// before\noids = [\"sysUpTime.0\"]\n// after\noids = [\"1.3.6.1.2.1.1.3.0\"]","handlingStrategy":"validation","validationCode":"Pattern NUMERIC_OID = Pattern.compile(\"\\\\d+(\\.\\d+)*\");\nfor (String oid : oids) {\n    String v = oid == null ? null : oid.trim();\n    if (v == null || !NUMERIC_OID.matcher(v).matches()) {\n        throw new IllegalArgumentException(\"OID must be numeric dotted form: \" + oid);\n    }\n}","typeGuard":"boolean isNumericOid(String oid) {\n    if (oid == null) return false;\n    String v = oid.trim();\n    if (v.startsWith(\".\")) v = v.substring(1);\n    return v.matches(\"\\\\d+(\\\\.\\\\d+)*\");\n}","tryCatchPattern":"try {\n    SnmpSourceConfig cfg = new SnmpSourceConfig(config);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"only numeric OIDs\")) {\n        // resolve MIB names to numeric form, e.g. via snmptranslate -On\n    }\n    throw e;\n}","preventionTips":["Convert MIB symbolic names with `snmptranslate -On` or an MIB browser before configuring","Strip leading dots and empty segments from OID strings","Reject or trim null/blank entries when building the oids list programmatically"],"tags":["config","snmp","format","oid"],"backgroundTag":"invalid-argument-format","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"}