Ticket #5585 (closed defect: duplicate)

Opened 3 years ago

Last modified 1 year ago

Notifications not working, seems like the listeners are not being registered

Reported by: jon.stockdill@gmail.com Assigned to: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I updated my tracdiscussion to:

URL: http://trac-hacks.org/svn/discussionplugin/0.11
Repository Root: http://trac-hacks.org/svn
Repository UUID: 7322e99d-02ea-0310-aa39-e9a107903beb
Revision: 6310
Node Kind: directory
Schedule: normal
Last Changed Author: Blackhex
Last Changed Rev: 6310
Last Changed Date: 2009-07-29 07:32:55 -0400 (Wed, 29 Jul 2009)

The notifications are still not working, seems like the listeners are not being registered.

I added:

self.log.error('self.message_change_listeners: ' + str(self.message_change_listeners))

to line 1167 of api.py and it prints: 2009-07-29 09:11:35,217 Trac[api] ERROR: self.message_change_listeners: []

I read http://trac.edgewall.org/wiki/TracDev/ComponentArchitecture but could not figure out how to get it registered. Is it a configuration issue or something else?

Let me know if there is anything I can do to help. I love the discussions and am excited about the notifications support.

Attachments

Change History

07/29/09 15:30:47 changed by anonymous

  • owner changed from Blackhex to anonymous.
  • status changed from new to assigned.

Have you enabled notification component?

tracdiscussion.notification.* = enabled

07/29/09 15:35:48 changed by Blackhex

  • owner changed from anonymous to Blackhex.
  • status changed from assigned to new.

07/29/09 15:36:11 changed by Blackhex

  • status changed from new to assigned.

07/29/09 16:49:07 changed by jon.stockdill@gmail.com

Thanks! That helped. That wired it... and makes total sense after reading the component documentation. The log now says:

self.message_change_listeners: [<tracdiscussion.notification.DiscussionEmailNotification object at 0x8f26a0c>]

And I am getting the following error and stack trace now:

NameError: global name 'DiscussionApi' is not defined
File "/cust/Trac-0.11.2.1/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 432, in _dispatch_request
  dispatcher.dispatch(req)
File "/cust/Trac-0.11.2.1/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 204, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-i686/egg/tracdiscussion/core.py", line 108, in process_requestFile "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 225, in process_discussionFile "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 1169, in _do_actionsFile "build/bdist.linux-i686/egg/tracdiscussion/notification.py", line 243, in message_created

07/29/09 16:56:33 changed by Blackhex

Oh god, not aggain :-). What is your installation procedure? Try to install the plugin from scratch. Check the DEBUG log if all components are loading... Otherwise I don't know... This kind of error shouldn't happen.

(follow-up: ↓ 7 ) 07/29/09 17:32:22 changed by jon.stockdill@gmail.com

I had a few eggs in site-packages, I removed all of them, built the egg from the HEAD of the 0.11 branch and restarted trac.

Here are the debug logs:

2009-07-29 11:17:26,021 Trac[loader] DEBUG: Loading TracDiscussion.spamfilter from /cu
st/Python-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,034 Trac[loader] DEBUG: Skipping "TracDiscussion.spamfilter = trac
discussion.spamfilter [spamfilter]": ("TracSpamFilter" not found)
2009-07-29 11:17:26,035 Trac[loader] DEBUG: Loading TracDiscussion.api from /cust/Pyth
on-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,040 Trac[loader] DEBUG: Loading TracDiscussion.init from /cust/Pyt
hon-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,041 Trac[loader] DEBUG: Loading TracDiscussion.core from /cust/Pyt
hon-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,042 Trac[loader] DEBUG: Loading TracDiscussion.search from /cust/P
ython-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,044 Trac[loader] DEBUG: Loading TracDiscussion.timeline from /cust
/Python-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,045 Trac[loader] DEBUG: Loading TracDiscussion.wiki from /cust/Pyt
hon-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,047 Trac[loader] DEBUG: Loading TracDiscussion.admin from /cust/Py
thon-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg
2009-07-29 11:17:26,048 Trac[loader] DEBUG: Loading TracDiscussion.notification from /
cust/Python-2.5.4/lib/python2.5/site-packages/TracDiscussion-0.7_r6310-py2.5.egg

From: http://trac-hacks.org/wiki/DiscussionPlugin

tracdiscussion.notification.DiscussionNotifyEmail = enabled

doesn't load the DiscussionEmailNotification?, so there are no listeners.

Changing it from:

tracdiscussion.notification.* = enabled

to

tracdiscussion.notification.DiscussionEmailNotification = enabled

Still generates the error:

NameError: global name 'DiscussionApi' is not defined

which makes sense.

My trac version is 0.11.2.1.

I appreciate the help and will continue to try and figure it out.

(in reply to: ↑ 6 ) 07/29/09 21:39:42 changed by anonymous

I appreciate the help and will continue to try and figure it out.

No, I appreciate your effort to investigate the problem.

Honestly, I really don't know where is the problem. Unforunatelly, I can't reproduce it until I know what server configuration are you using (OS, tracd, mod_python, Apache+CGI, Python version, etc.)? Just few shoots in the dark:

  • Try to change line 17 in notification.py to from tracdiscussion.api import DiscussionApi
  • Check content of plugin's egg, especially presence and content of api.py file (rename it to zip).
  • Change line 204 in notification.py to api = api = DiscussionApi(self, context.req)
  • Check or add to trac.ini tracdiscussion.api.DiscussionApi = enabled.

I'm not sure if anything of this may help, I'll ask on #trac IRC channel at freenode.org otherwise.

04/29/10 15:20:12 changed by Blackhex

Ping?

09/05/10 06:02:11 changed by rjollos

Is it possible you have the AnnouncerPlugin installed?

12/08/10 23:29:19 changed by Blackhex

  • status changed from assigned to closed.
  • resolution set to duplicate.

In that case it's duplicate of #7636.


Add/Change #5585 (Notifications not working, seems like the listeners are not being registered)




Change Properties
Action