calmh/node-snmp-native

Error on parsing SNMP message

KingRial opened this issue · 2 comments

I was working with a TCW241
TCW241-Ethernet-I-O-module-user-manual-R4.2.pdf

If i try to interrogate the states of the sensors using ".getAll" I get the following error:

Woops! An error occurred while parsing an SNMP message. :(
To have this problem corrected, please report the information below verbatim
via email to snmp@nym.se or by creating a GitHub issue at
https://github.com/calmh/node-snmp-native/issues

Thanks!

AssertionError [ERR_ASSERTION]: 48 == undefined
    at parse (C:\Sviluppo\GitLab\Clevermind\Cloud\services\Technology-SNMP\node_modules\snmp-native\lib\snmp.js:260:12)
    at Session.msgReceived (C:\Sviluppo\GitLab\Clevermind\Cloud\services\Technology-SNMP\node_modules\snmp-native\lib\snmp.js:411:15)
    at emitTwo (events.js:126:13)
    at Socket.emit (events.js:214:7)
    at UDP.onMessage [as onmessage] (dgram.js:658:8)

Message data:
    30 82 00 1b 02 01 01 04 06 70 75 62 6c 69 63 a2
    82 00 0c 02 04 5c 2c 8c 01 02 01 01 02 01 00
events.js:183
      throw er; // Unhandled 'error' event
      ^

AssertionError [ERR_ASSERTION]: 48 == undefined
    at parse (C:\Sviluppo\GitLab\Clevermind\Cloud\services\Technology-SNMP\node_modules\snmp-native\lib\snmp.js:260:12)
    at Session.msgReceived (C:\Sviluppo\GitLab\Clevermind\Cloud\services\Technology-SNMP\node_modules\snmp-native\lib\snmp.js:411:15)
    at emitTwo (events.js:126:13)
    at Socket.emit (events.js:214:7)
    at UDP.onMessage [as onmessage] (dgram.js:658:8)

Just followed the instructions and shared the problem.

Sensors are not present and problably this is the reason of such situation (maybe when missing the devide doesn't really handle correctly the SNMP standard )
Everything else works correctly.

I would like to be able to handle the error and ignore the OIDs which trigger it, instead of seeing the entire "getAll" explode ( the "abortOnError" options doesn't seem to work ).
Any help to understand it would be nice!

EDIT:
If I use ".get" instead of ".getAll" the problem doesn't occur.
The only difference is that with ".getAll" I use an array of OIDs; if I use ".get" I need to cycle over the array and do the single call for every entry (it's far from perfection but it works)

hhm, this sounds like a buggy SNMP implementation, given that get() works while getAll() fails. It would not be the first time that a SNMP implementation chokes on getNext()...

you should be able to catch the AssertionError and then you can take a look at the nolog branch, which is less noisy about these errors...

Thanks,
I can confirm it's a problem of the SNMP integration on the device.