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

Alert profiles with vendor-based filters seems to crash the Alertengine completely #1455

Closed
lunkwill42 opened this issue Feb 2, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@lunkwill42
Copy link
Member

By creating an alert profile subscribing to a filter group containing a filter based on vendor ("equipment vendor"), it seems it is possible to provoke the alertengine to crash and stop. This traceback is logged:

Traceback (most recent call last):
  File "/usr/lib/nav/alertengine.py", line 153, in main
    check_alerts(debug=opttest)
  File "/usr/lib/python2.7/dist-packages/nav/alertengine/base.py", line 63, in check_alerts
    handle_new_alerts(new_alerts)
  File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 394, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/nav/alertengine/base.py", line 187, in handle_new_alerts
    permissions)
  File "/usr/lib/python2.7/dist-packages/nav/alertengine/base.py", line 201, in _check_match_and_permission
    if memoized_check_alert(alert, filtergroupcontents, 'match check'):
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 38, in wrapper
    result = func(*args)
  File "/usr/lib/python2.7/dist-packages/nav/alertengine/base.py", line 459, in check_alert_against_filtergroupcontents
    matches = content.filter.check(alert) != content.positive
  File "/usr/lib/python2.7/dist-packages/nav/models/profiles.py", line 861, in check
    if AlertQueue.objects.filter(**filtr).exclude(**exclude).extra(
  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 691, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 709, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1331, in add_q
    clause, require_inner = self._add_q(where_part, self.used_aliases)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1358, in _add_q
    current_negated=current_negated, connector=connector)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 1225, in build_filter
    lookups, value)
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/related.py", line 1530, in get_lookup_constraint
    raise exceptions.FieldError('Relation fields do not support nested lookups')
FieldError: Relation fields do not support nested lookups
@lunkwill42 lunkwill42 added the bug label Feb 2, 2017
@lunkwill42 lunkwill42 added this to the 4.6.2 milestone Feb 2, 2017
@lunkwill42 lunkwill42 self-assigned this Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant