ipdevpoll UnicodeDecodeError when storing unidentified LLDP neighbors

Bug #968917 reported by Morten Brekkevold
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Medium
Morten Brekkevold

Bug Description

This traceback has been observed in ipdevpoll.log (NAV 3.11.1):

2012-03-25 09:08:10,383 [ERROR jobs.jobhandler] [topo some-sw.example.org] Plugin nav.ipdevpoll.plugins.lldp.LLDP(u'some-sw.example.org') reported an unhandled failure
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 345, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 424, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 441, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 949, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 891, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.6/dist-packages/twisted/python/failure.py", line 338, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/plugins/lldp.py", line 60, in handle
    yield threads.deferToThread(self._process_remote)
  File "/usr/lib/python2.6/dist-packages/twisted/python/threadpool.py", line 207, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.6/dist-packages/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/db.py", line 109, in _autocommit
    result = func(*args, **kw)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/plugins/lldp.py", line 72, in _process_remote
    [n.record for n in neighbors if not n.identified])
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/plugins/lldp.py", line 104, in _process_unidentified
    self._store_unidentified(record)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/plugins/lldp.py", line 115, in _store_unidentified
    neighbor.remote_id = unicode(record.chassis_id)
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0x9e in position 1: ordinal not in range(128)

tags: added: ipdevpoll
tags: added: unicode
summary: - ipdevpoll UnicodeDecodeError when storing LLDP neighbors
+ ipdevpoll UnicodeDecodeError when storing unidentified LLDP neighbors
Changed in nav:
status: Confirmed → In Progress
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: In Progress → Fix Committed
milestone: none → 3.11.2
Changed in nav:
status: Fix Committed → Fix Released
Revision history for this message
Galindro (bruno-galindro) wrote :
Download full text (3.2 KiB)

Morten,

   This bug still occurs in NAV 3.14.15926-1 (installed via apt-get). Here is the error message:

2013-07-26 09:04:58,093 [INFO nav.ipdevpoll] --- Starting ipdevpolld topo ---
2013-07-26 09:04:58,704 [INFO plugins] Imported 21 plugin classes, 21 classes in plugin registry
2013-07-26 09:04:58,704 [INFO nav.ipdevpoll] Running single 'topo' job for x.y.252.66
2013-07-26 09:04:59,449 [ERROR jobs.jobhandler] [topo x.y.252.66] Plugin nav.ipdevpoll.plugins.lldp.LLDP(u'x.y.252.66') reported an unhandled failure
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 345, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 424, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 441, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 949, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 891, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.6/dist-packages/twisted/python/failure.py", line 338, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/plugins/lldp.py", line 65, in handle
    yield run_in_thread(self._process_remote)
  File "/usr/lib/python2.6/dist-packages/twisted/python/threadpool.py", line 207, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.6/dist-packages/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/db.py", line 152, in _reset
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/db.py", line 111, in _autocommit
    result = func(*args, **kw)
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/plugins/lldp.py", line 83, in _process_remote
    neighbors = [LLDPNeighbor(lldp) for lldp in self.remote]
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/neighbor.py", line 113, in __init__
    self.identify()
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/neighbor.py", line 116, in identify
    self.netbox = self._identify_netbox()
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/neighbor.py", line 255, in _identify_netbox
    netbox = lookup(str(chassid))
  File "/usr/lib/pymodules/python2.6/nav/ipdevpoll/neighbor.py", line 133, in _netbox_from_ip
    ip = unicode(ip)
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 0: ordinal not in range(128)

2013-07-26 09:04:59,450 [ERROR jobs.jobhandler] [topo x.y.252.66] Job 'topo' for x.y.252.66 aborted: Job aborted due to plugin failure (cause=UnicodeDecodeError('ascii', '\xf0}h\xd6\xbb\x12', 0, 1, 'ordinal not in range(1...

Read more...

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

This is an entirely different issue, Bruno. An error during the parsing of an IP address. A plain-text IP address will always be decodeable as ASCII. It appears something other than an actual IP address has been retrieved from the x.y.252.66 device.

Would you please report this as a separate bug?

Revision history for this message
Galindro (bruno-galindro) wrote :
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.