OpenNMS is unable to finish scanning nodes with broken / missing IP-MIB::ipAddressIfIndex entries, and will retry forever without ever marking the node as scanned. This has been confirmed on OpenNMS 19.x and 20.0, but it's probably been the case in older versions as well.
The underlying cause - in my situation, at least - is a presumably broken SNMP implementation on specific equipment / versions. I'm only interested in the primary SNMP interface's IP address, which I provision through a foreign requisition, so the problem with the missing ipAddressIfIndex data is entirely harmless in my environment.
Unfortunately, IPAddressTableTracker fails to check whether it received any data from ipAddressIfIndex before attempting to parse the result, and because of this, the node scan is aborted due to a NullPointerException:
"The Node with Id: 1; ForeignSource: Dev; ForeignId:testdevice has aborted for the following reason: Aborting node scan : Agent failed while scanning the IP address tables : java.lang.NullPointerException"
I've attached a sample of the relevant snmp data... or rather, the data that is missing, along with the relevant debug logs from provisiond.log.
I'm also attaching a tiny patch with a quick and easy fix, primarily to pinpoint the problem and offer a solution along with my bug report. If the patch is used as-is, that's perfectly fine by me, since it solves the problem in my dev environment, by adding an extra warning before returning null:
2017-06-09 20:24:12,919 WARN [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.p.s.IPAddressTableTracker: BAD AGENT: Device is missing IP-MIB::ipAddressIfIndex. Skipping.
2017-06-09 20:24:12,919 INFO [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.p.s.NodeScan: Processing IPAddress table row with ipAddr null
This way, OpenNMS is able to successfully detect all services, snmp interfaces and finally update the node's lastcapsdpoll timestamp.