#5585 closed defect (duplicate)
Notifications not working, seems like the listeners are not being registered
Reported by: | Owned by: | Radek Bartoň | |
---|---|---|---|
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 (0)
Change History (10)
comment:1 Changed 15 years ago by
Owner: | changed from Radek Bartoň to anonymous |
---|---|
Status: | new → assigned |
comment:2 Changed 15 years ago by
Owner: | changed from anonymous to Radek Bartoň |
---|---|
Status: | assigned → new |
comment:3 Changed 15 years ago by
Status: | new → assigned |
---|
comment:4 Changed 15 years ago by
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
comment:5 Changed 15 years ago by
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.
comment:6 follow-up: 7 Changed 15 years ago by
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.
comment:7 Changed 15 years ago by
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.
comment:10 Changed 14 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
In that case it's duplicate of #7636.
Have you enabled notification component?