I have a box with the Inventory-job flagged as red. When I run the job form the command-line I get the following error:
/usr/local/nav/bin/ipdevpolld -J inventory -n <boxname>
2018-09-25 08:37:19,646 [INFO nav.ipdevpoll] --- Starting ipdevpolld inventory --- 2018-09-25 08:37:26,439 [INFO plugins] Imported 30 plugin classes, 30 classes in plugin registry 2018-09-25 08:37:26,439 [INFO nav.ipdevpoll] Running single 'inventory' job for <boxname> 2018-09-25 08:37:26,497 [WARNING plugins.typeoid.typeoid] [inventory <boxname> ] Netbox has changed type from unknown to 1.3.6.1.4.1.42610.1.4.4 2018-09-25 08:37:26,561 [ERROR jobs.jobhandler] [inventory <boxname>] Plugin nav.ipdevpoll.plugins.modules.Modules(u'<boxname>') reported an unhandled failure Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 423, in errback self._startRunCallbacks(fail) File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks self._runCallbacks() File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 577, in _runCallbacks current.result = callback(current.result, *args, **kw) File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1155, in gotResult _inlineCallbacks(r, g, deferred) --- <exception caught here> --- File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks result = result.throwExceptionIntoGenerator(g) File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator return g.throw(self.type, self.value, self.tb) File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 51, in handle need_to_collect = yield self._need_to_collect() File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks result = result.throwExceptionIntoGenerator(g) File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator return g.throw(self.type, self.value, self.tb) File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 62, in _need_to_collect yield self.stampcheck.load() File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks result = result.throwExceptionIntoGenerator(g) File "/usr/local/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator return g.throw(self.type, self.value, self.tb) File "/usr/local/nav/lib/python/nav/ipdevpoll/timestamps.py", line 108, in load self.loaded_times = yield db.run_in_thread(_unpickle) File "/usr/local/lib/python2.7/site-packages/twisted/python/threadpool.py", line 196, in _worker result = context.call(ctx, function, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext return func(*args,**kw) File "/usr/local/nav/lib/python/nav/ipdevpoll/db.py", line 100, in _reset return func(*args, **kwargs) File "/usr/local/nav/lib/python/nav/ipdevpoll/timestamps.py", line 100, in _unpickle key=INFO_KEY_NAME, variable=self.var_name) File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python2.7/site-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 NetboxInfo -- it returned 2!
2018-09-25 08:37:26,561 [ERROR jobs.jobhandler] [inventory <boxname>] Job 'inventory' for <boxname> aborted: Job aborted due to plugin failure (cause=MultipleObjectsReturned('get() returned more than one NetboxInfo -- it returned 2!',))
OK, something is duplicated in my database, but where shall I look?
--Ingeborg
On Tue, 25 Sep 2018 08:43:29 +0200 Ingeborg Hellemo ingeborg.hellemo@uit.no wrote:
I have a box with the Inventory-job flagged as red. When I run the job form the command-line I get the following error:
/usr/local/nav/bin/ipdevpolld -J inventory -n <boxname>
[snip]
nav.models.manage.MultipleObjectsReturned: get() returned more than one NetboxInfo -- it returned 2!
2018-09-25 08:37:26,561 [ERROR jobs.jobhandler] [inventory <boxname>] Job 'inventory' for <boxname> aborted: Job aborted due to plugin failure (cause=MultipleObjectsReturned('get() returned more than one NetboxInfo -- it returned 2!',))
OK, something is duplicated in my database, but where shall I look?
Oh noes, those dreaded duplications!
It looks like you've somehow accrued a duplicate timestamp for module collection for a single IP device, although I'm not sure how.
Simplest way out of this situation is to just delete all module collection timestamps:
DELETE FROM netboxinfo WHERE key='poll_times' AND var='modules';
And if it happens again, maybe post a bug report, and we'll see if there isn't a better way to fix this.
ingeborg.hellemo@uit.no said:
I have a box with the Inventory-job flagged as red. When I run the job form the command-line I get the following error:
Another box, another error:
2018-10-18 12:27:19,085 [INFO nav.ipdevpoll] --- Starting ipdevpolld inventory --- 2018-10-18 12:27:25,704 [INFO plugins] Imported 30 plugin classes, 30 classes in plugin registry 2018-10-18 12:27:25,704 [INFO nav.ipdevpoll] Running single 'inventory' job for <boxname> 2018-10-18 12:27:27,539 [ERROR jobs.jobhandler] [inventory <boxname>] Plugin nav.ipdevpoll.plugins.modules.Modules(u'<boxname>') reported an unhandled failure Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 382, in callback self._startRunCallbacks(result) File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks self._runCallbacks() File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 577, in _runCallbacks current.result = callback(current.result, *args, **kw) File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1155, in gotResult _inlineCallbacks(r, g, deferred) --- <exception caught here> --- File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks result = g.send(result) File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 57, in handle self._process_entities(physical_table) File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 155, in _process_entities module_containers = self._process_modules(entities) File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 111, in _process_modules module = self._module_from_entity(ent) File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 97, in _module_from_entity module.description = ent['entPhysicalDescr'].strip() exceptions.AttributeError: 'NoneType' object has no attribute 'strip'
2018-10-18 12:27:27,540 [ERROR jobs.jobhandler] [inventory <boxname>] Job 'inventory' for mh2-U09-T03-sw4.infra.uit.no aborted: Job aborted due to plugin failure (cause=AttributeError("'NoneType' object has no attribute 'strip'",))
Is this due to an error in the database og faulty snmp implementation on the box (Type C9410R (Catalyst 9400 Series 10 Slot Chassis from cisco))?
--Ingeborg
On Thu, 18 Oct 2018 12:33:40 +0200 Ingeborg Hellemo ingeborg.hellemo@uit.no wrote:
Another box, another error:
[snip]
File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/modules.py", line 97, in _module_from_entity module.description = ent['entPhysicalDescr'].strip() exceptions.AttributeError: 'NoneType' object has no attribute 'strip'
Is this due to an error in the database og faulty snmp implementation on the box (Type C9410R (Catalyst 9400 Series 10 Slot Chassis from cisco))?
I'd say it's a combination of poor SNMP implementation and a bug in NAV. This would happen your C9410R reports modules that have no description value at all - although, the NAV code should have expected something like this could happen and safeguarded against it.