LLDP topology bug when two devices share the same initial sysname

Bug #1634903 reported by Aaron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Committed
Medium
Morten Brekkevold
4.6
Fix Released
Medium
Morten Brekkevold

Bug Description

In our case we have a netbox called na10.acc.xxx and a environment probe called na10.env.xxx.

When ipdevpoll runs the topology plugin on the netbox na11 which is a neighbor device of na10, it retrieves the sysname and tries to fetch the device on NAV called NA10.

NA11# sh ll i r

 LLDP Remote Devices Information

  LocalPort | ChassisId PortId PortDescr SysName
  --------- + ------------------------- ------ --------- ----------------------
  25 | 00 11 0a xx xx xx 50 50 NA10
  26 | a0 1d 48 xx xx xx 25 25 NA12

When the query is doen, it returns two devices (na10.acc & na10.env) and that crashes the whole process.

This is the full traceback error:

2016-10-19 08:08:15,565 [31596] [ERROR jobs.jobhandler] [topo na11.acc.xxx] Plugin nav.ipdevpoll.plugins.lldp.LLDP(u'na11.acc.xxx') reported an unhandled failure
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 423, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1155, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/plugins/lldp.py", line 65, in handle
    yield run_in_thread(self._process_remote)
  File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 196, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/db.py", line 98, in _reset
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/plugins/lldp.py", line 85, in _process_remote
    neighbors = [LLDPNeighbor(lldp) for lldp in self.remote]
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/neighbor.py", line 112, in __init__
    self.identify()
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/neighbor.py", line 115, in identify
    self.netbox = self._identify_netbox()
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/neighbor.py", line 280, in _identify_netbox
    netbox = self._netbox_from_sysname(self.record.sysname)
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/neighbor.py", line 172, in _netbox_from_sysname
    return cls._netbox_query(query)
  File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/neighbor.py", line 185, in _netbox_query
    netbox = manage.Netbox.objects.values('id', 'sysname').get(query)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 361, in get
    num if num <= MAX_GET_RESULTS else 'more than %s' % MAX_GET_RESULTS
nav.models.manage.MultipleObjectsReturned: get() returned more than one Netbox -- it returned 2!

2016-10-19 08:08:15,566 [31596] [ERROR jobs.jobhandler] [topo na11.acc.xxx] Job 'topo' for na11.acc.xxx aborted: Job aborted due to plugin failure (cause=MultipleObjectsReturned('get() returned more than one Netbox -- it returned 2!',))

I discussed this with Lunkwill on IRC. It seems that ProCurve switches do not use the system MAC address for any communication so it can't be retrieved through ARP/CAM tables, that's why it's trying to use the sysname to detect the neighbor device instead of it's MAC address.

Lunkwill suggested a possible solution. I would require that the bridge plugin inside ipdevpoll queried the system mac address, stored it somewhere in the database and use it for matching the lldp neighbor.

I would be happy to troubleshoot it with but I don't think I'm capable of code it myself :/.

Thanks for the great app!

Changed in nav:
status: New → Confirmed
assignee: nobody → Morten Brekkevold (mbrekkevold)
importance: Undecided → Medium
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → Fix Committed
milestone: none → 4.5.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.