noSuchInstance causing problems during provision scan

Description

A user on the discuss list has a GPON (gigabit passive optical network) device that is returning an SNMP noSuchInstance error for some OIDs during a provisioning scan and this appears to be causing exceptions in provisiond that prevent complete scanning.

We should be catching this exception and continuing on to the next OID in the walk which is what snmpwalk appears to do.

2015-12-08 13:08:33,926 WARN [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.TableTracker: Failed to process response java.lang.IllegalArgumentException: cannot convert noSuchInstance to a HexString at org.opennms.netmgt.snmp.snmp4j.Snmp4JValue.toHexString(Snmp4JValue.java:258) ~[org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.opennms.netmgt.provision.service.PhysInterfaceTableTracker$PhysicalInterfaceRow.getPhysAddr(PhysInterfaceTableTracker.java:194)~[opennms-provisiond-16.0.4.jar:?] at org.opennms.netmgt.provision.service.PhysInterfaceTableTracker$PhysicalInterfaceRow.createInterfaceFromRow(PhysInterfaceTableTracker.java:224)~[opennms-provisiond-16.0.4.jar:?] at org.opennms.netmgt.provision.service.NodeScan$AgentScan$3.processPhysicalInterfaceRow(NodeScan.java:579) ~[opennms-provisiond-16.0.4.jar:?] at org.opennms.netmgt.provision.service.PhysInterfaceTableTracker.rowCompleted(PhysInterfaceTableTracker.java:256)~[opennms-provisiond-16.0.4.jar:?] at org.opennms.netmgt.snmp.SnmpTableResult.handleCompleteRows(SnmpTableResult.java:99) ~[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.SnmpTableResult.storeResult(SnmpTableResult.java:75) ~[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.TableTracker.storeResult(TableTracker.java:106)~[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.CollectionTracker.storeResult(CollectionTracker.java:77) ~[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.ColumnTracker$1.processResponse(ColumnTracker.java:100) ~[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.TableTracker$CombinedColumnResponseProcessor.processResponse(TableTracker.java:170)[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.AggregateTracker$ChildTrackerResponseProcessor.processResponse(AggregateTracker.java:165)[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.SnmpWalker.processResponse(SnmpWalker.java:202)[org.opennms.core.snmp.api-16.0.4.jar:?] at org.opennms.netmgt.snmp.snmp4j.Snmp4JWalker.access$700(Snmp4JWalker.java:48) [org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.opennms.netmgt.snmp.snmp4j.Snmp4JWalker$Snmp4JResponseListener.processResponse(Snmp4JWalker.java:151)[org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.opennms.netmgt.snmp.snmp4j.Snmp4JWalker$Snmp4JResponseListener.onResponse(Snmp4JWalker.java:180)[org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.Snmp.processPdu(Snmp.java:1203)[org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.MessageDispatcherImpl.fireProcessPdu(MessageDispatcherImpl.java:675) [org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.MessageDispatcherImpl.dispatchMessage(MessageDispatcherImpl.java:302) [org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:373) [org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:333) [org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.transport.AbstractTransportMapping.fireProcessMessage(AbstractTransportMapping.java:76)[org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:414)[org.opennms.core.snmp.implementations.snmp4j-16.0.4.jar:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Benjamin Reed August 2, 2017 at 2:30 PM

Passed in Bamboo.  As soon as someone can review it for sanity we can merge this to foundation-2017.

Benjamin Reed August 1, 2017 at 1:35 PM

Benjamin Reed July 28, 2017 at 7:30 PM
Edited

I've updated the branch to a) handle exceptions more gracefully, and b) check if the SnmpValue is an error before attempting to convert it to a hex string.  Assuming it passes, I'll create a PR. https://bamboo.opennms.org/browse/OPENNMS-ONMS1715

Jeff Gehlbach July 27, 2017 at 12:18 AM

It's absurd that we would try to convert a noSuchInstance to a HexString. Agreed we should just move along when we get one; that's part of how SNMP works.

Benjamin Reed October 5, 2016 at 1:28 PM

NoSuchInstance may be normal, but it does seem reasonable to continue to attempt getting data after a single row fails... Catching the exception in row-processing does appear to not break any existing tests: http://bamboo.internal.opennms.com:8085/browse/OPENNMS-ONMS1024-1

Fixed

Details

Assignee

Reporter

Sprint

Affects versions

Priority

PagerDuty

Created December 15, 2015 at 9:55 AM
Updated September 20, 2017 at 3:32 PM
Resolved August 2, 2017 at 2:36 PM

Flag notifications