Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for bug 1295092 causes ipdevpoll inventory jobs to crash for Cisco devices #23

Closed
jmbredal opened this issue Jan 17, 2017 · 3 comments

Comments

@jmbredal
Copy link
Collaborator

jmbredal commented Jan 17, 2017

The fix for bug 1295092 causes ipdevpoll inventory jobs to crash fail in the psu plugin whenver a Cisco device is being queried.

The fix introduced changes to how the EntityTable class works. Unfortunately, it appears that the implementation for CISCO-ENTITY-FRU-MIB is misusing the EntityTable class to manipulate data from other tables than the ENTITY-MIB::entPhysicalTable. The EntityTable class should NOT be used at all here!


Imported from Launchpad using lp2gh.

@jmbredal
Copy link
Collaborator Author

(by mbrekkevold)
example Traceback:

2014-03-28 12:47:56,367 [ERROR jobs.jobhandler] [inventory cisco.example.org] Plugin nav.ipdevpoll.plugins.psu.PowerSupplyUnit(u'IP') reported an unhandled failure
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 391, in errback
self._startRunCallbacks(fail)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks
self._runCallbacks()
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult
_inlineCallbacks(r, g, deferred)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/psu.py", line 121, in handle
yield self._handle_unit(psu_or_fan)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/local/nav/lib/python/nav/ipdevpoll/plugins/psu.py", line 141, in _handle_unit
ret = yield control.is_psu_up(internal_index)
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/local/nav/lib/python/nav/mibs/cisco_entity_fru_control_mib.py", line 118, in is_psu_up
self.psu_status_table = yield self._get_power_status_table()
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/local/nav/lib/python/nav/mibs/cisco_entity_fru_control_mib.py", line 62, in _get_power_status_table
table = yield self._get_named_table('cefcFRUPowerStatusTable')
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
result = g.send(result)
File "/usr/local/nav/lib/python/nav/mibs/cisco_entity_fru_control_mib.py", line 50, in _get_named_table
status_table = EntityTable(named_table)
File "/usr/local/nav/lib/python/nav/mibs/entity_mib.py", line 114, in init
self.clean()
File "/usr/local/nav/lib/python/nav/mibs/entity_mib.py", line 194, in clean
self._fix_broken_chassis_relative_positions()
File "/usr/local/nav/lib/python/nav/mibs/entity_mib.py", line 210, in _fix_broken_chassis_relative_positions
chassis = self.get_chassis()
File "/usr/local/nav/lib/python/nav/mibs/entity_mib.py", line 163, in get_chassis
if self.is_chassis(entity)]
File "/usr/local/nav/lib/python/nav/mibs/entity_mib.py", line 125, in is_chassis
return e['entPhysicalClass'] == 'chassis'
exceptions.KeyError: 'entPhysicalClass'

@jmbredal
Copy link
Collaborator Author

(by mbrekkevold)
fix here: https://nav.uninett.no/hg/stable/rev/446e1d8e3e11

@jmbredal jmbredal added this to the 3.15.8 milestone Jan 17, 2017
@jmbredal
Copy link
Collaborator Author

Translated changeset references:
https://nav.uninett.no/hg/stable/rev/446e1d8e3e11: ea0326d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant