Modify

Opened 5 years ago

Closed 3 years ago

Last modified 22 months ago

#5585 closed defect (duplicate)

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

Reported by: jon.stockdill@… Owned by: 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 (0)

Change History (10)

comment:1 Changed 5 years ago by anonymous

  • Owner changed from Blackhex to anonymous
  • Status changed from new to assigned

Have you enabled notification component?

tracdiscussion.notification.* = enabled

comment:2 Changed 5 years ago by Blackhex

  • Owner changed from anonymous to Blackhex
  • Status changed from assigned to new

comment:3 Changed 5 years ago by Blackhex

  • Status changed from new to assigned

comment:4 Changed 5 years ago by jon.stockdill@…

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 5 years ago 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.

comment:6 follow-up: Changed 5 years ago by jon.stockdill@…

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 in reply to: ↑ 6 Changed 5 years ago 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.

comment:8 Changed 4 years ago by Blackhex

Ping?

comment:9 Changed 4 years ago by rjollos

Is it possible you have the AnnouncerPlugin installed?

comment:10 Changed 3 years ago by Blackhex

  • Resolution set to duplicate
  • Status changed from assigned to closed

In that case it's duplicate of #7636.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from Blackhex. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.