alertengine crashes after alert profile is deleted

Bug #702257 reported by Vidar Stokkenes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Medium
Morten Brekkevold

Bug Description

alertengine seems to crash if there are pending alerts to be sent to a deleted alert profile.

Here is the debug output:

[2011-01-10 08:51:23,560] [INFO] [pid=9914 nav.alertengine.alertaddress.send] alert 448651 sent by SMS to XXXXXXXX due to immediately subscription 140
[2011-01-10 08:51:23,573] [INFO] [pid=9914 nav.alertengine.handle_queued_alerts] Sending alert 448560 right away as the users profile has been disabled
[2011-01-10 08:51:23,575] [CRITICAL] [pid=9914 nav.alertengine] Unhandeled error: 'NoneType' object has no attribute 'ignore_resolved_alerts'
Traceback (most recent call last):
  File "/usr/lib/nav/alertengine.py", line 157, in main
    check_alerts(debug=opttest)
  File "/var/lib/python-support/python2.5/nav/alertengine/base.py", line 70, in check_alerts
    sent_daily, sent_weekly, num_sent_alerts, num_failed_sends, num_resolved_alerts_ignored = handle_queued_alerts(queued_alerts, now)
  File "/var/lib/python-support/python2.5/nav/alertengine/base.py", line 320, in handle_queued_alerts
    if subscription.ignore_resolved_alerts and subscription.type != AlertSubscription.NOW and end and end < now:
AttributeError: 'NoneType' object has no attribute 'ignore_resolved_alerts'
Traceback (most recent call last):
  File "/usr/lib/nav/alertengine.py", line 294, in <module>
    main(sys.argv[1:])
  File "/usr/lib/nav/alertengine.py", line 178, in main
    raise e
AttributeError: 'NoneType' object has no attribute 'ignore_resolved_alerts'

DPaste snippet here: http://dpaste.org/F879/

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

The problem is confirmed by looking at the code. Is this a real crash, i.e. the process dies? Or does it continue after logging this?

Changed in nav:
assignee: nobody → Morten Brekkevold (mbrekkevold)
importance: Undecided → Medium
milestone: none → 3.7.3
status: New → Confirmed
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

fix here: http://metanav.uninett.no/hg/series/3.7.x/rev/5cce5ec5d2b2 (patch tested by Vidar himself)

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

Some details on this one:

This error occurs when this sequence of events happen:
1. A user has an active profile that queues alerts (daily, weekly, next time period)
2. There are alerts waiting in the user's queue
3. The user deletes or deactivates said profile (or removes the subscription that caused the alerts to be queued).

Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers