louislam/uptime-kuma · error · Error

No varbinds returned from SNMP session (OID: ${monitor.snmpO

Error message

No varbinds returned from SNMP session (OID: ${monitor.snmpOid})

What it means

Thrown after session.get() resolves successfully but the returned varbinds array is empty. net-snmp calls back with (null, []) in edge cases where the agent returns a GetResponse PDU carrying no variable bindings. Because the monitor queries exactly one OID, an empty varbind set is treated as an unrecoverable protocol violation rather than a value mismatch.

Source

Thrown at server/monitor-types/snmp.js:53

            }

            // Handle errors during session creation
            session.on("error", (error) => {
                throw new Error(`Error creating SNMP session: ${error.message}`);
            });

            const varbinds = await new Promise((resolve, reject) => {
                session.get([monitor.snmpOid], (error, varbinds) => {
                    error ? reject(error) : resolve(varbinds);
                });
            });
            log.debug(
                this.name,
                `SNMP: Received varbinds (Type: ${snmp.ObjectType[varbinds[0].type]} Value: ${varbinds[0].value})`
            );

            if (varbinds.length === 0) {
                throw new Error(`No varbinds returned from SNMP session (OID: ${monitor.snmpOid})`);
            }

            if (varbinds[0].type === snmp.ObjectType.NoSuchInstance) {
                throw new Error(`The SNMP query returned that no instance exists for OID ${monitor.snmpOid}`);
            }

            // We restrict querying to one OID per monitor, therefore `varbinds[0]` will always contain the value we're interested in.
            const value = varbinds[0].value;

            const { status, response } = await evaluateJsonQuery(
                value,
                monitor.jsonPath,
                monitor.jsonPathOperator,
                monitor.expectedValue
            );

            if (status) {
                heartbeat.status = UP;

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Validate the OID with an external tool (snmpget) against the same host/community/version to confirm the agent returns a varbind.
  2. Match monitor.snmpVersion to the agent's actual SNMP version (1, 2c, or 3).
  3. If using community auth, confirm monitor.radiusPassword holds the correct community string for this monitor type.
  4. If the agent is known to return empty responses for unsupported OIDs, choose a different, populated OID.
Defensive patterns

Strategy: validation

Validate before calling

function validateVarbinds(varbinds, oid) {
  if (!Array.isArray(varbinds) || varbinds.length === 0) {
    throw new Error(`No varbinds returned from SNMP session (OID: ${oid})`);
  }
  return varbinds;
}

Type guard

function hasVarbind(vbs) {
  return Array.isArray(vbs) && vbs.length > 0 && typeof vbs[0].type !== "undefined";
}

Try / catch

try {
  const varbinds = await getAsync(session, monitor.snmpOid);
  if (!hasVarbind(varbinds)) throw new Error(`No varbinds (OID: ${monitor.snmpOid})`);
} catch (e) {
  heartbeat.status = DOWN; heartbeat.msg = e.message;
}

Prevention

When it happens

Trigger: Produced when the agent responds to the GetRequest with a syntactically valid PDU that contains zero varbind entries, or when a net-snmp version quirk normalizes certain error PDUs into an empty array instead of an error. Also possible if the agent is a misbehaving proxy or a non-RFC-compliant device.

Common situations: Querying a lightweight/buggy embedded agent (printers, PDUs, IoT firmware) that omits varbinds on certain OIDs; pointing at a port that is SNMP-speaking but answering a different community context; SNMP version mismatch (e.g. querying a v2c-only device with v1 semantics) producing truncated responses.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/5ba1fae0fd796a23. Report an issue: GitHub.