AlertEngine mailbombs: AlertQueueMessage matching query does not exist

Bug #347226 reported by Morten Brekkevold
2
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
High
Thomas Adamcik

Bug Description

AlertEngine on a NAV 3.5.2 installation kept mailbombing us with the following traceback:

[2009-03-23 09:28:27,018] [ERROR] [pid=23987 nav.alertengine.alertaddress.send] Unhandeled error from SMS (the handler has been blacklisted)
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/nav/models/profiles.py", line 269, in send
    self.type.send(self, alert, language=lang)
  File "/usr/lib/python2.4/site-packages/nav/models/profiles.py", line 310, in send
    return self.handler_instance.send(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/nav/alertengine/dispatchers/sms_dispatcher.py", line 44, in send
    message = alert.messages.get(language=language, type='sms').message
  File "/var/lib/python-support/python2.4/django/db/models/manager.py", line 93, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/var/lib/python-support/python2.4/django/db/models/query.py", line 302, in get
    raise self.model.DoesNotExist("%s matching query does not exist."
DoesNotExist: AlertQueueMessage matching query does not exist.

A similar traceback is also mailed for the Email handler.

Previous experience indicates that this error may appear when accountalertqueue records refer to non-existant alertq records. Inspection of the database reveals that this is not the case here.

When AlertEngine was restarted, the mailbombing stopped, as it began blacklisting the handlers instead (as the above traceback shoiws). But the effect of this is that no alerts are sent whatsoever.

Tags: alertengine
Changed in nav:
assignee: nobody → adamcik
importance: Undecided → High
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Could the problem be that there are no entries in the alertqmsg table for the alert that is being attempted dispatched?

I see no other choice to resolve this situation than by removing the accountalertqueue entries forcefully.

Thomas Adamcik (adamcik)
Changed in nav:
status: New → In Progress
Changed in nav:
milestone: none → v3.5.3
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Fix committed and pushed to series/3.5.x: http://metanav.uninett.no/hg/series/3.5.x/rev/42054f5775b9

Changed in nav:
status: In Progress → Fix Committed
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

This is linked with bug 353121. The fix for that bug will make eventEngine always create some alert message, even if the template is missing.

After applying the alertengine fix for this issue, alertengine will still refuse to send alerts where e.g. there is no message text for the user's selected alert language. It will remain in the queue indefinitely, and AlertEngine will complain on every queue run that it can't be sent.

Message texts will never be changed or added for an alert once it has been posted, so there should be a different strategy here. I think AlertEngine should fall back to using the English language alert text if a message for the user's selected language isn't available.

Also, what does AlertEngine do if there is no message text available for the media it wants?

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.