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

Eventengine's modulestate plugin will not handle alerts on modules that have duplicates #1437

Closed
lunkwill42 opened this issue Jan 27, 2017 · 0 comments
Assignees
Milestone

Comments

@lunkwill42
Copy link
Member

lunkwill42 commented Jan 27, 2017

There is an unhandled MultipleObjectsReturned exception in the eventengine modulestate plugin.
Observed under NAV 4.6.0, a customer has a device that reports duplicates of all its modules in ENTITY-MIB::entPhysicalTable.

This causes problems for the modulestate plugin in the event engine, as the attempt to fetch the module's corresponding entity returns multiple matches:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nav/eventengine/engine.py", line 67, in _decorated
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/nav/eventengine/plugins/delayedstate.py", line 168, in _make_down_warning
    self._post_down_warning()
  File "/usr/lib/python2.7/dist-packages/nav/eventengine/plugins/modulestate.py", line 79, in _post_down_warning
    if self._is_chassis_down():
  File "/usr/lib/python2.7/dist-packages/nav/eventengine/plugins/modulestate.py", line 92, in _is_chassis_down
    chassis = self.get_target().get_chassis()
  File "/usr/lib/python2.7/dist-packages/nav/models/manage.py", line 668, in get_chassis
    me = self.get_entity()
  File "/usr/lib/python2.7/dist-packages/nav/models/manage.py", line 657, in get_entity
    device=self.device)
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 361, in get
    num if num <= MAX_GET_RESULTS else 'more than %s' % MAX_GET_RESULTS
MultipleObjectsReturned: get() returned more than one NetboxEntity -- it returned 2!
@lunkwill42 lunkwill42 self-assigned this Jan 27, 2017
@lunkwill42 lunkwill42 added the bug label Jan 27, 2017
@lunkwill42 lunkwill42 changed the title Unhandled MultipleObjectsReturned exception in event engine modulestate plugin Eventengine's modulestate plugin will not handle alerts on module's that have duplicates Jan 27, 2017
@lunkwill42 lunkwill42 added this to the 4.6.2 milestone Jan 27, 2017
@lunkwill42 lunkwill42 changed the title Eventengine's modulestate plugin will not handle alerts on module's that have duplicates Eventengine's modulestate plugin will not handle alerts on modules that have duplicates Mar 10, 2017
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