Modify

Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#5772 closed defect (fixed)

Can't watch tickets

Reported by: Jimmy Owned by: Martin Scharrer
Priority: high Component: WatchlistPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

Hi,

I installed Watchlist plugin on my TRAC 0.11.3. It's a good plugin to make me to watch my favorite tickets and wikis.

I can add a wiki to my watchlist, but I can't add a ticket to the list.

When I clicked "watch" in the ticket page, I got the internal error below.

Oops… Trac detected an internal error:

NameError: global name 'commentnum' is not defined

This is probably a local installation issue. Found a bug in Trac?

If you think this should work and you can reproduce the problem, you should consider reporting this to the Trac team.

Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.

Otherwise, please ==== How to Reproduce ==== While doing a GET operation on /watchlist, Trac issued an internal error. (please provide additional details here) Request parameters: {'action': u'watch', 'is_watching': False, 'realm': u'ticket', 'resid': u'1', 'ticket_perm': True, 'wiki_perm': True, 'wikilist': []} User Agent was: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5 (.NET CLR 3.5.30729) ==== System Information ====
Trac 0.11.3 Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51)
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)]
setuptools 0.6c9 SQLite 3.5.9 pysqlite 2.3.3 Genshi 0.5.1 Pygments 1.0 GIT 1.5.6.6 jQuery: 1.2.6

Python Traceback

Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 205, in dispatch resp = chosen_handler.process_request(req) File "build/bdist.linux-i686/egg/tracwatchlist/plugin.py", line 221, in process_request changes.extend( [format_change(field,oldvalue,newvalue), tag("; ") ]) File "build/bdist.linux-i686/egg/tracwatchlist/plugin.py", line 204, in format_change href=href('ticket',id,action='diff',version=commentnum)), ")") NameError: global name 'commentnum' is not defined a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it. Python Traceback Most recent call last:

  • File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request Code fragment:
    1. try:
    2. if not env and env_error:
    3. raise HTTPInternalError(env_error)
    4. try:
    5. dispatcher = RequestDispatcher(env)
    6. dispatcher.dispatch(req)
    7. except RequestDone:
    8. pass
    9. resp = req._response or []
    10. except HTTPException, e:
    Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher <trac.web.main.RequestDispatcher object at 0x9577aac> e NameError("global name 'commentnum' is not defined",) env <trac.env.Environment object at 0x894510c> env_error None exc_info (<type 'exceptions.NameError'>, NameError("global name 'commentnum' is not ... filename '/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py' frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 434 message u"NameError: global name 'commentnum' is not defined" req <Request "GET u'/watchlist'"> resp [] tb <traceback object at 0x97a7f04> tb_hide None traceback 'Traceback (most recent call last):\n File ...
  • File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 205, in dispatch Code fragment:
    1. req.args.get('FORM_TOKEN') != req.form_token:
    2. raise HTTPBadRequest('Missing or invalid form token. '
    3. 'Do you have cookies enabled?')
    4. # Process the request and render the template
    5. resp = chosen_handler.process_request(req)
    6. if resp:
    7. if len(resp) == 2: # Clearsilver
    8. chrome.populate_hdf(req)
    9. template, content_type = \
    10. self._post_process_request(req, *resp)
    Local variables: Name Value chosen_handler <tracwatchlist.plugin.WatchlinkPlugin object at 0x957e22c> chrome <trac.web.chrome.Chrome object at 0x9577a0c> err (<type 'exceptions.NameError'>, NameError("global name 'commentnum' is not ... handler <tracwatchlist.plugin.WatchlinkPlugin object at 0x957e22c> req <Request "GET u'/watchlist'"> self <trac.web.main.RequestDispatcher object at 0x9577aac>
  • File "build/bdist.linux-i686/egg/tracwatchlist/plugin.py", line 221, in process_request Local variables: Name Value action 'view' args {'resid': u'1', 'wikilist': [], 'ticket_perm': True, 'action': u'watch', ... author u'Jimmy.Wu' author_ u'Jimmy.Wu' changes [<Fragment>, <Fragment>] changetime 1251798343 count (1,) cursor <trac.db.util.IterableCursor object at 0x97a6434> db <trac.db.pool.PooledConnection object at 0x97a9a6c> field u'description' format_change <function format_change at 0x97a4b1c> href <trac.web.href.Href object at 0x957e9ec> id 1 is_watching False lst (u'Jimmy.Wu', u'ticket', u'1') newvalue u'= bug description =\r\n\r\n= bug analysis =\r\naaa\r\n= fix ... oldvalue u'= bug description =\r\n\r\n= bug analysis =\r\n\r\n= fix recommendation ... realm u'ticket' realm_perm True reporter u'Jimmy.Wu' req <Request "GET u'/watchlist'"> resid u'1' self <tracwatchlist.plugin.WatchlinkPlugin object at 0x957e22c> summary u'test' ticket_perm True ticketlist [] tickets [(1, u'enhancement', 1251797379, 1251798343, u'test', u'Jimmy.Wu')] time 1251797379 timeline '/sw1-trac/timeline?precision=seconds&from=' timeline_link <function timeline_link at 0x97a4c6c> type u'enhancement' user u'Jimmy.Wu' wiki_perm True wikilist [] wldict {'resid': u'1', 'wikilist': [], 'ticket_perm': True, 'action': u'watch', ... wlhref '/sw1-trac/watchlist'
  • File "build/bdist.linux-i686/egg/tracwatchlist/plugin.py", line 204, in format_change Local variables: Name Value field u'description' fieldtag <Element "strong"> href <trac.web.href.Href object at 0x957e9ec> id 1 newvalue u'= bug description =\r\n\r\n= bug analysis =\r\naaa\r\n= fix ... oldvalue u'= bug description =\r\n\r\n= bug analysis =\r\n\r\n= fix recommendation ... self <tracwatchlist.plugin.WatchlinkPlugin object at 0x957e22c>

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 205, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-i686/egg/tracwatchlist/plugin.py", line 221, in process_requestFile "build/bdist.linux-i686/egg/tracwatchlist/plugin.py", line 204, in format_change

Attachments (0)

Change History (6)

comment:1 Changed 15 years ago by Martin Scharrer

Status: newassigned

Hi, could you please check if this happens with all tickets independently if they have comments or not. Maybe the 'last comment' entry is not really initialised for tickets without comments.

comment:2 Changed 15 years ago by Martin Scharrer

I added a small fix in [6492] which might fix this. Please update to the newest SVN version and test it again. Please post future error messages wrapped between {{{ and }}} lines to have them verbatim. Larger error messages should be attached as files.

comment:3 Changed 15 years ago by anonymous

Resolution: worksforme
Status: assignedclosed

I patch it. Watchlist plugin is working well now. Thanks!

comment:4 Changed 15 years ago by Ivan

I patched my Trac 0.11.5 with [6492] and it helped me too. Thanks!

comment:5 Changed 15 years ago by Martin Scharrer

Resolution: worksforme
Status: closedreopened

comment:6 Changed 15 years ago by Martin Scharrer

Resolution: fixed
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Martin Scharrer.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.