{"record":{"id":"3a55f6bc8bf35db5","repo":"louislam/uptime-kuma","slug":"the-snmp-query-returned-that-no-instance-exists-fo","errorCode":null,"errorMessage":"The SNMP query returned that no instance exists for OID ${monitor.snmpOid}","messagePattern":"The SNMP query returned that no instance exists for OID (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/monitor-types/snmp.js","lineNumber":57,"sourceCode":"                throw new Error(`Error creating SNMP session: ${error.message}`);\n            });\n\n            const varbinds = await new Promise((resolve, reject) => {\n                session.get([monitor.snmpOid], (error, varbinds) => {\n                    error ? reject(error) : resolve(varbinds);\n                });\n            });\n            log.debug(\n                this.name,\n                `SNMP: Received varbinds (Type: ${snmp.ObjectType[varbinds[0].type]} Value: ${varbinds[0].value})`\n            );\n\n            if (varbinds.length === 0) {\n                throw new Error(`No varbinds returned from SNMP session (OID: ${monitor.snmpOid})`);\n            }\n\n            if (varbinds[0].type === snmp.ObjectType.NoSuchInstance) {\n                throw new Error(`The SNMP query returned that no instance exists for OID ${monitor.snmpOid}`);\n            }\n\n            // We restrict querying to one OID per monitor, therefore `varbinds[0]` will always contain the value we're interested in.\n            const value = varbinds[0].value;\n\n            const { status, response } = await evaluateJsonQuery(\n                value,\n                monitor.jsonPath,\n                monitor.jsonPathOperator,\n                monitor.expectedValue\n            );\n\n            if (status) {\n                heartbeat.status = UP;\n                heartbeat.msg = `JSON query passes (comparing ${response} ${monitor.jsonPathOperator} ${monitor.expectedValue})`;\n            } else {\n                throw new Error(\n                    `JSON query does not pass (comparing ${response} ${monitor.jsonPathOperator} ${monitor.expectedValue})`","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/snmp.js#L39-L75","documentation":"Thrown when varbinds[0].type equals snmp.ObjectType.NoSuchInstance. NoSuchInstance is a per-object error indicator defined by RFC 3416: the agent understood the GetRequest and the variable binding syntax, but no managed object instance exists at the requested OID. It is distinct from a transport error or a noSuchObject (wrong type/leaf) response.","triggerScenarios":"Triggered by session.get() when the OID names a scalar/column that the agent implements but has no instance for, or when querying a table column OID without a row index suffix. Also occurs when the instance has been deleted or is not yet populated on the device.","commonSituations":"Querying a table column OID directly (e.g. 1.3.6.1.2.1.2.2.1.10) without appending .ifIndex; querying an interface counter OID for an interface that no longer exists; pointing at an OID from a different device model where that MIB subtree is absent; stale documentation referencing an OID that the firmware revision no longer exposes.","solutions":["Use snmpwalk/snmpget externally to find a concrete instance OID for this device, then paste the full leaf-with-index OID into monitor.snmpOid.","If the OID is a table column, append the relevant row index (e.g. interface index) to select a real instance.","Confirm the device model/firmware actually implements the MIB at that OID.","Switch to a known-good scalar OID (e.g. sysUpTime.0 = 1.3.6.1.2.1.1.3.0) to verify the path before reintroducing the target OID."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const snmp = require(\"net-snmp\");\nfunction assertInstancePresent(varbind, oid) {\n  if (varbind.type === snmp.ObjectType.NoSuchInstance) {\n    throw new Error(`No instance for OID ${oid}`);\n  }\n  return varbind;\n}","typeGuard":"function isInstancePresent(varbind) {\n  return varbind && varbind.type !== snmp.ObjectType.NoSuchInstance && varbind.type !== snmp.ObjectType.NoSuchObject;\n}","tryCatchPattern":"if (!isInstancePresent(varbinds[0])) { heartbeat.status = DOWN; heartbeat.msg = `No instance for ${monitor.snmpOid}`; return; }","preventionTips":["Always query a concrete leaf OID with its index suffix.","Walk the MIB once to confirm the instance exists before pinning the monitor OID.","Prefer scalar OIDs ending in .0 for simple health checks."],"tags":["snmp","net-snmp","oid","mib","protocol"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}