Modify

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#11570 closed defect (fixed)

Plugin installed but not working

Reported by: russell.ballestrini@… Owned by: jun66j5
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 7 months 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 7 months ago by russellballestrini

  • Cc russell.ballestrini@… added

comment:3 Changed 7 months ago by jun66j5

  • Resolution set to fixed
  • Status changed from new to closed

In 13660:

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

comment:4 Changed 7 months ago by jun66j5

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

Add Comment

Modify Ticket

Action
as 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.