Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11570 closed defect (fixed)

Plugin installed but not working

Reported by: Russell Ballestrini Owned by: Jun Omae
Priority: high Component: TracHtmlNotificationPlugin
Severity: blocker Keywords:
Cc: Russell Ballestrini Trac Release: 1.0

Description

I installed the plugin by creating an egg from SVN and dropping into the plugins directory and adding the two configuration lines in the proper sections of the trac.ini file.

In the trac admin web gui, the plugin shows up and is enabled.

Email still is sent without converting to HTML (raw trac ticket/wiki markup).

I enabled debugging log and created a new ticket, here are the python trace backs that show up in the log:

Most likely related

014-02-13 01:16:15,243 Trac[notification] WARNING: Caught exception while substituting message
Traceback (most recent call last):
  File "/cars/trac/cars-sm/plugins/TracHtmlNotificationPlugin-0.12.0.1-py2.7.egg/trachtmlnotification/notification.py", line 72, in substitute_message
    return self._substitute_message(chrome, req, message)
  File "/cars/trac/cars-sm/plugins/TracHtmlNotificationPlugin-0.12.0.1-py2.7.egg/trachtmlnotification/notification.py", line 126, in _substitute_message
    html = self._create_html_body(chrome, req, ticket, cnum, link)
  File "/cars/trac/cars-sm/plugins/TracHtmlNotificationPlugin-0.12.0.1-py2.7.egg/trachtmlnotification/notification.py", line 163, in _create_html_body
    rendered = chrome.render_template(req, template, data, fragment=True)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/trac/web/chrome.py", line 983, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/genshi/core.py", line 133, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/trac/web/chrome.py", line 1162, in inner
    data)
  File "/cars/trac/cars-sm/plugins/TracSubcomponents-1.2.0-py2.7.egg/subcomponents/web_ui.py", line 135, in filter_stream
    elif req.path_info.startswith('/query'):
AttributeError: 'Mock' object has no attribute 'path_info'

Most likely _not_ related

Traceback (most recent call last):
  File "/cars/trac/.env/local/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/cars/trac/cars-sm/plugins/TracTicketChainedFields-0.1-py2.7.egg/tcf/web_ui.py", line 197, in process_request
    trigger_values = locate_trigger_values(tcf_define_target)
UnboundLocalError: local variable 'tcf_define_target' referenced before assignment

As a work around I attempted to delete the possibly conflicting plugin (TracSubcomponents plugin) but alas we still get the same 'Mock' trace back but hitting on another plugin (TracSubTicketsPlugin), here is the trace back after removing the first plugin:

Traceback (most recent call last):
  File "/cars/trac/cars-sm/plugins/TracHtmlNotificationPlugin-0.12.0.1-py2.7.egg/trachtmlnotification/notification.py", line 72, in substitute_message
    return self._substitute_message(chrome, req, message)
  File "/cars/trac/cars-sm/plugins/TracHtmlNotificationPlugin-0.12.0.1-py2.7.egg/trachtmlnotification/notification.py", line 126, in _substitute_message
    html = self._create_html_body(chrome, req, ticket, cnum, link)
  File "/cars/trac/cars-sm/plugins/TracHtmlNotificationPlugin-0.12.0.1-py2.7.egg/trachtmlnotification/notification.py", line 163, in _create_html_body
    rendered = chrome.render_template(req, template, data, fragment=True)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/trac/web/chrome.py", line 983, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/genshi/core.py", line 133, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/cars/trac/.env/local/lib/python2.7/site-packages/trac/web/chrome.py", line 1162, in inner
    data)
  File "/cars/trac/cars-sm/plugins/TracSubTicketsPlugin-0.2.0.dev_20131121-py2.7.egg/tracsubtickets/web_ui.py", line 137, in filter_stream
    if req.path_info.startswith('/ticket/'):
AttributeError: 'Mock' object has no attribute 'path_info'

As you can see the TracHtmlNotificationPlugin seem to be incompatible with a good number of other plugins, I assume after removing all the offenders emails would render in HTML.

Attachments (0)

Change History (4)

comment:1 Changed 11 years ago by Russell Ballestrini

Confirmed - After I removed the following plugins emails were rendered with HTML

TracSubcomponents-1.2.0-py2.7.egg
TracSubTicketsPlugin-0.2.0.dev_20131121-py2.7.egg
trac_subtickettypes-0.2.1-py2.7.egg

We need these plugins for our workflows so this isn't a great work around but hopefully my research will help you narrow down where the defect is.

Thanks

comment:2 Changed 11 years ago by Russell Ballestrini

Cc: Russell Ballestrini added; anonymous removed

comment:3 Changed 11 years ago by Jun Omae

Resolution: fixed
Status: newclosed

In 13660:

TracHtmlNotificationPlugin: avoid an AttributeError due to accessing attribute of request object in filter_stream of plugin (closes #11570)

comment:4 Changed 11 years ago by Jun Omae

Thanks for the details. Please try the latest and feel free to reopen this ticket if you encounter it again.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
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.