ipdevpoll inventory job fails with AttributeError: 'NoneType' object has no attribute 'strip'

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

Bug Description

Under NAV 4.3.0, the ipdevpoll inventory job fails every time on a Juniper device where there really is only chassis information in NetboxEntity (not from the ENTITY-MIB), when it appears a chassis has been replaced.

Traceback looks as follows (this is in fact compounded by the fact that the NetboxEntity class __unicode__ method does not behave properly on missing attributes):

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 525, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 172, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/source/python/nav/ipdevpoll/db.py", line 152, in _reset
    return func(*args, **kwargs)
  File "/source/python/nav/ipdevpoll/db.py", line 111, in _autocommit
    result = func(*args, **kw)
  File "/source/python/nav/ipdevpoll/db.py", line 130, in _cleanup
    return func(*args, **kwargs)
  File "/source/python/nav/ipdevpoll/jobs.py", line 372, in complete_save_cycle
    self.cleanup_containers_after_save()
  File "/source/python/nav/ipdevpoll/jobs.py", line 390, in cleanup_containers_after_save
    manager.cleanup()
  File "/source/python/nav/ipdevpoll/shadows/entity.py", line 89, in cleanup
    to_purge = self.get_purge_list()
  File "/source/python/nav/ipdevpoll/shadows/entity.py", line 114, in get_purge_list
    sub = subtree(graph, miss)
  File "/usr/local/lib/python2.7/dist-packages/networkx/algorithms/traversal/depth_first_search.py", line 55, in dfs_tree
    T.add_edges_from(dfs_edges(G,source))
  File "/usr/local/lib/python2.7/dist-packages/networkx/classes/digraph.py", line 549, in add_edges_from
    for e in ebunch:
  File "/usr/local/lib/python2.7/dist-packages/networkx/algorithms/traversal/depth_first_search.py", line 36, in dfs_edges
    stack = [(start,iter(G[start]))]
  File "/usr/local/lib/python2.7/dist-packages/networkx/classes/graph.py", line 319, in __getitem__
    return self.adj[n]
exceptions.KeyError: <KeyError instance at 0x7ea5b90 with str error:
 Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/_reflectpy3.py", line 294, in _safeFormat
    return formatter(o)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 373, in __repr__
    u = unicode(self)
  File "/source/python/nav/models/manage.py", line 451, in __unicode__
    if klass and not title.strip().lower().startswith(klass.lower()):
AttributeError: 'NoneType' object has no attribute 'strip'

Tags: ipdevpoll
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
importance: Undecided → Medium
status: Confirmed → Fix Committed
Changed in nav:
status: Fix Committed → Fix Released
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.