gm-notify stops updating

Bug #1023166 reported by James Harkins
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gm-notify (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After some period of usage (varies, could be an hour, could be less), gm-notify doesn't update anymore.

If it shows no new messages, and new mail comes in, it should pop up a notification and change the mail icon's color, but nothing happens.

If it shows new messages and I read all of them, it should change the mail icon back to black, but nothing happens.

Once this bug starts happening, the number of new messages shown in the messaging menu never changes.

The only clue I get is, if I run gm-notify from the commandline:

Unhandled Error
Traceback (most recent call last):
  File "/build/buildd/python2.7-2.7.3/Modules/pyexpat.c", line 618, in EndElement

  File "/usr/lib/python2.7/dist-packages/twisted/words/xish/domish.py", line 797, in _onEndElement
    self.ElementEvent(self.currElem)
  File "/usr/lib/python2.7/dist-packages/twisted/words/xish/xmlstream.py", line 107, in onElement
    self.dispatch(element)
  File "/usr/lib/python2.7/dist-packages/twisted/words/xish/utility.py", line 317, in dispatch
    callbacklist.callback(obj)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/words/xish/utility.py", line 107, in callback
    methodwrapper(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/words/xish/utility.py", line 27, in __call__
    self.method(*nargs, **nkwargs)
  File "/usr/lib/python2.7/dist-packages/gtalk.py", line 94, in send_callback_handler
    callback(data, **kargs)
  File "/usr/lib/python2.7/dist-packages/gtalk.py", line 193, in gotLabel
    self.queryLabel()
  File "/usr/lib/python2.7/dist-packages/gtalk.py", line 160, in queryLabel
    if self.mails and self.cb_new: self.cb_new(self.mails)
  File "/usr/bin/gm-notify", line 181, in new_mail
    self.showNotification(_("Incoming message"), text.strip("\n"))
  File "/usr/bin/gm-notify", line 218, in showNotification
    n.show()
gio.Error: GDBus.Error:org.freedesktop.Notifications.MaxNotificationsExceeded: Exceeded maximum number of notifications

Description: Ubuntu 12.04 LTS
Release: 12.04

  Installed: 0.10.3-0ubuntu2
  Candidate: 0.10.3-0ubuntu2
  Version table:
 *** 0.10.3-0ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Quin Eirik (morpfh) wrote :

As a short fix you can do:
$ killall notification-daemon
when you recognize issue.

This will stop the notification-daemon and start it "fresh" on next notification.

The problem is with notification-daemon. It has a hard-coded limit of 20. This is, AFAIK, how many messages can be in the queue simultaneously. Problem is that when notifications close by them selves the queue is not updated properly.

However: If I _manually_ close each message, by clicking the [x] on the notification, the g_hash_table_size(daemon->priv->queue) is updated. On my system it seems to be a limit of 22 - or by "some magic" two of the messages get removed.

A quick-hack (not a fix) is to run a script to kill the daemon on error. E.g:

$HOME/bin/notify-limit-err-kill

[Code]:

#!/bin/bash

debug=0

dbus-monitor "type='error'" |
while read buf; do
 ((debug)) && printf >&2 "MESSG: %-40s\n" "$buf"
 if [[ "$buf" == 'string "Exceeded maximum number of notifications"' ]]; then
  killall notification-daemon
 fi
done

[EOF Code]

$ chmod +x notify-limit-err-kill
And add it as a startup script (or launch it manually).

You will, however, by this, loose the one notification that caused the error.
I have a script for catching this as well, and re-transmitting after spawn of daemon - but code is a bit ugly ...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gm-notify (Ubuntu):
status: New → Confirmed
Revision history for this message
Quin Eirik (morpfh) wrote :

Seems like gm-notify hangs after error. (Never used it before). So, to extend the ugly hack-fix add something like:

  killall gm-notify
  sleep 3
  gm-notify &

inside the "if".

tags: added: notification-daemon
tags: added: gm-notify notification
Revision history for this message
Quin Eirik (morpfh) wrote :

As gm-notify kill itself on startup the "killall gm-notify" is not needed.

Simply add
gm-notify &
inside the "if" and it takes care of the rest.

REF:
/usr/bn/gm-notify: line 60
class CheckMail():
    def __init__(self):
        '''initiates DBUS-Messaging interface, creates the MailChecker and registers with indicator-applet.
        In the end it starts the periodic check timer and a gtk main-loop'''

        # Kill running gm-notify processes (UGLY!)
        subprocess.call("kill `pgrep -f gm-notify | grep -v %s`" % os.getpid(), stdout=open("/dev/null", "w"), shell=True)
       ...

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.