CDP/LLDP neighbor matching fails when multiple ports match the identification
Bug #1447973 reported by
Morten Brekkevold
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
High
|
Morten Brekkevold |
Bug Description
A customer reports the topo job consistently failing for one of their switches. A huge traceback reveals that as ipdevpoll attempts to match a CDP record to a neighboring port, multiple Interface objects are returned. The code doesn't expect this, and crashes.
With some added debug logging, it appears the CDP record in question uses the neighboring port's ifalias value as its identification. The neighboring switch, unfortunately, has four ports with this same ifalias value, causing the code to glitch.
Multiple matches should be treated equivalent to no match, and should probably be logged too.
Changed in nav: | |
milestone: | 4.2.7 → 4.3.0 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The traceback looks like this:
2015-04-24 09:53:28,554 [ERROR jobs.jobhandler] [topo example- sw.example. org] Plugin nav.ipdevpoll. plugins. cdp.CDP( u'example- sw.example. org') reported an unhandled failure python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 397, in errback _startRunCallba cks(fail) python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 464, in _startRunCallbacks _runCallbacks( ) python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 551, in _runCallbacks current. result, *args, **kw) python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 1101, in gotResult backs(r, g, deferred) python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 1043, in _inlineCallbacks throwExceptionI ntoGenerator( g) python2. 7/dist- packages/ twisted/ python/ failure. py", line 382, in throwExceptionI ntoGenerator python2. 7/dist- packages/ nav/ipdevpoll/ plugins/ cdp.py" , line 64, in handle thread( self._process_ cache) python2. 7/dist- packages/ twisted/ python/ threadpool. py", line 207, in _worker python2. 7/dist- packages/ twisted/ python/ context. py", line 118, in callWithContext text(). callWithContext (ctx, func, *args, **kw) python2. 7/dist- packages/ twisted/ python/ context. py", line 81, in callWithContext python2. 7/dist- packages/ nav/ipdevpoll/ db.py", line 152, in _reset python2. 7/dist- packages/ nav/ipdevpoll/ db.py", line 111, in _autocommit python2. 7/dist- packages/ nav/ipdevpoll/ plugins/ cdp.py" , line 82, in _process_cache python2. 7/dist- packages/ nav/ipdevpoll/ neighbor. py", line 115, in __init__ python2. 7/dist- packages/ nav/ipdevpoll/ neighbor. py", line 119, in identify interface( ) python2. 7/dist- packages/ nav/ipdevpoll/ neighbor. py", line 257, in _identify_interface _from_name( self.record. deviceport) python2. 7/dist- packages/ nav/ipdevpoll/ neighbor. py", line 218, in _interface_ from_name _query( netbox & query) python2. 7/dist- packages/ nav/ipdevpoll/ neighbor. py", line 227, in _interface_query ).get(netbox & query) python2. 7/dist- packages/ django/ db/models/ query.py" , line 368, in get _meta.object_ name, num, kwargs)) manage. MultipleObjects Returned: get() returned more than one Interface -- it returned 4! Lookup parameters were {}
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
current.result = callback(
File "/usr/lib/
_inlineCall
--- <exception caught here> ---
File "/usr/lib/
result = result.
File "/usr/lib/
return g.throw(self.type, self.value, self.tb)
File "/usr/lib/
yield run_in_
File "/usr/lib/
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
result = func(*args, **kw)
File "/usr/lib/
neighbors = [CDPNeighbor(cdp, self.netbox.ip) for cdp in self.cache]
File "/usr/lib/
self.identify()
File "/usr/lib/
self.interface = self._identify_
File "/usr/lib/
return self._interface
File "/usr/lib/
ifc = self._interface
File "/usr/lib/
'id', 'ifname', 'ifdescr', 'iftype'
File "/usr/lib/
% (self.model.
nav.models.