lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
356 stars 152 forks source link

Wrong response sequence, and receiving what appears to be Int32.MinValue #381

Closed lextudio-support closed 4 hours ago

lextudio-support commented 4 hours ago

Hello everyone.

This issue appears to be similar to the one described by: http://sharpsnmplib.codeplex.com/discussions/250704 but I think it's a bit different.

Using the SharpSnmpLib v7.0.10213.18, we get the following message:

2013-03-22 11:27:47,478 [192.168.2.12_Poll] ERROR ConnectivityManager.SNMPInterface.SNMPHelper [(null)] - Failed to access CiscoCommunity@101 SNMP subtree for host: 192.168.2.12
wrong response sequence: expected -16777212, received -2147483644. Agent: 192.168.2.12

Which comes from SnmpMessageExtension.cs from method "GetResponse".

Thoughts on how to workaround this issue? There are many of these messages and they appear to start @ -2147483648, ironically the minimum value of an Int32.

In order to help responses, we also did get this stacktrace a bit earlier from when we get these weird messages:

Lextm.SharpSnmpLib.SnmpException: unsupported data type: 87
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\DataFactory.cs:line 120
at Lextm.SharpSnmpLib.Messaging.MessageFactory.ParseMessage(Int32 first, Stream stream, UserRegistry registry) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\MessageFactory.cs:line 123
at Lextm.SharpSnmpLib.Messaging.MessageFactory.ParseMessages(Byte[] buffer, Int32 index, Int32 length, UserRegistry registry) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\MessageFactory.cs:line 108
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, UserRegistry registry, Socket udpSocket) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 422
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, Socket udpSocket) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 347
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 305
at Lextm.SharpSnmpLib.Messaging.Messenger.HasNext(VersionCode version, IPEndPoint endpoint, OctetString community, Variable seed, Int32 timeout, Variable& next) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\Messenger.cs:line 218
at Lextm.SharpSnmpLib.Messaging.Messenger.Walk(VersionCode version, IPEndPoint endpoint, OctetString community, ObjectIdentifier table, IList`1 list, Int32 timeout, WalkMode mode) in C:\Views\software\ConnectivityManager\sharpsnmplib_213dd1a20aad\SharpSnmpLib\Messaging\Messenger.cs:line 187
at ConnectivityManager.SNMPInterface.SNMPHelper.GetSubTree(IPAddress AgentHost, String Community, String OID) in C:\Views\software\ConnectivityManager\ConnectivityManager.SNMPInterface\SNMPHelper.cs:line 54

Many thanks in advance :)

Original Reported Date: 2013-03-27T20:57:07.51-07:00 Original CodePlex Discussion Thread ID: 438261

lextudio-support commented 4 hours ago

Copied from CodePlex without authors:

You will have to start network packet capture and reproduce the errors. Then by analyzing them we might locate hints on the root cause.

Regards,

Lex

Original Posted Date: 2013-03-27T22:59:56.5-07:00

lextudio-support commented 4 hours ago

Marked as Answer Date: 2013-10-06T04:04:58.11-07:00