ipdevpoll : Save stage failed with unhandled AttributeError

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

Bug Description

NAV : 3.6.0b6
OS : RHEL 5.5

ipdevpoll gives this error for a number of our netboxes. I cant find any similarities between them :

2010-09-29 10:55:54,464 [ERROR] [nav.ipdevpoll.jobs.jobhandler.inventory.(gw.foo.tld)] Save stage failed with unhandled error:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/python/threadpool.py", line 161, in _worker
    context.call(ctx, function, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/internet/threads.py", line 24, in _putResultInDeferred
    result = f(*args, **kwargs)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/utils.py", line 143, in _commit_on_success
    result = func(*args, **kwargs)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/utils.py", line 162, in _cleanup
    return func(*args, **kwargs)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/jobs.py", line 269, in complete_save_cycle
    result = self.perform_save()
  File "/usr/local/nav/lib/python/nav/ipdevpoll/jobs.py", line 318, in perform_save
    obj_model = obj.convert_to_model(self.containers)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/storage.py", line 239, in convert_to_model
    model = self.get_existing_model(containers)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/shadows.py", line 302, in get_existing_model
    result = self.lookup_matching_objects(containers)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/shadows.py", line 281, in lookup_matching_objects
    query = manage.Interface.objects.filter(netbox__id=self.netbox.id)
exceptions.AttributeError: 'NoneType' object has no attribute 'id'

Changed in nav:
assignee: nobody → Morten Brekkevold (mbrekkevold)
importance: Undecided → Medium
milestone: none → 3.6.0
status: New → Confirmed
summary: - ipdevpoll : Save stage failed with unhandled error
+ ipdevpoll : Save stage failed with unhandled AttributeError
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Download full text (3.4 KiB)

I sent a patch for macrom to test, but a similar thing happened (the reasoning is the same: Some plugin called upon the containers factory function and created a new Interface that the Interfaces plugin did not see. Probably some mumbo jumbo response from a MIB). The traceback after the first patch was:

2010-09-29 12:52:42,322 [ERROR] [nav.ipdevpoll.jobs.jobhandler.inventory.(switch.foo.tld)] The last query was: {'time': '0.020', 'sql': 'INSERT INTO "interface" ("netboxid", "moduleid", "ifindex", "ifname", "ifdescr", "iftype", "speed", "ifphysaddress", "ifadminstatus", "ifoperstatus", "iflastchange", "ifconnectorpresent", "ifpromiscuousmode", "ifalias", "baseport", "media", "vlan", "trunk", "duplex", "to_netboxid", "to_interfaceid", "gone_since") VALUES (513, NULL, NULL, E\'\', E\'\', NULL, NULL, NULL, NULL, NULL, NULL, false, false, E\'\', 21, NULL, NULL, false, NULL, NULL, NULL, NULL)'}
2010-09-29 12:52:55,616 [ERROR] [nav.ipdevpoll.jobs.jobhandler.inventory.(switch.foo.tld)] Save stage failed with unhandled error:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/python/threadpool.py", line 161, in _worker
    context.call(ctx, function, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.4/site-packages/Twisted-8.1.0-py2.4-linux-i686.egg/twisted/internet/threads.py", line 24, in _putResultInDeferred
    result = f(*args, **kwargs)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/utils.py", line 143, in _commit_on_success
    result = func(*args, **kwargs)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/utils.py", line 162, in _cleanup
    return func(*args, **kwargs)
  File "/usr/local/nav/lib/python/nav/ipdevpoll/jobs.py", line 269, in complete_save_cycle
    result = self.perform_save()
  File "/usr/local/nav/lib/python/nav/ipdevpoll/jobs.py", line 331, in perform_save
    obj_model.save()
  File "/usr/lib/python2.4/site-packages/django/db/models/base.py", line 311, in save
    self.save_base(force_insert=force_insert, force_update=force_update)
  File "/usr/lib/python2.4/site-packages/django/db/models/base.py", line 383, in save_base
    result = manager._insert(values, return_id=update_pk)
  File "/usr/lib/python2.4/site-packages/django/db/models/manager.py", line 138, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/usr/lib/python2.4/site-packages/django/db/models/query.py", line 894, in insert_query
    return query.execute_sql(return_id)
  File "/usr/lib/python2.4/site-packages/django/db/models/sql/subqueries.py", line 309, in execute_sql
    cursor = super(InsertQuery, self).execute_sql(None)
  File "/usr/lib/python2.4/site-packages/django/db/models/...

Read more...

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
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.