Edgewall Software
Modify

Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#13211 closed defect (cantfix)

EmailDistributor throws an error, notification is not working

Reported by: thomas.schabetsberger@… Owned by:
Priority: normal Milestone:
Component: notification Version: 1.4
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:

Description

  • Upgraded from Trac 1.2.5 to 1.4 using pip
  • Since upgrade notifications are not working any more

Trac Log:

2019-09-21 17:11:29,918 Trac[mail] WARNING: EmailDistributor caught exception while formatting ticket to text/plain for email: <class 'trac.ticket.notification.TicketFormatter'>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/trac/notification/mail.py", line 383, in distribute
    outputs[fmt] = formatter.format(transport, fmt, event)
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/notification.py", line 143, in format
    return self._format_plaintext(event)
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/notification.py", line 248, in _format_plaintext
    return self._format_body(data, 'ticket_notify_email.txt')
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/notification.py", line 313, in _format_body
    template = chrome.load_template(template_name, text=True)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line 1370, in load_template
    return self._load_jinja_template(filename, text)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line 1396, in _load_jinja_template
    return (self.jenv_text if text else self.jenv).get_template(filename)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 125, in load
    code = environment.compile(source, name, filename)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 591, in compile
    self.handle_exception(exc_info, source_hint=source_hint)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/var/data/trac/templates/ticket_notify_email.txt", line 4, in template
    pv = [(a[0].strip(), a[1].strip()) for a in [b.split(':') for b in
TemplateSyntaxError: expected token ',', got 'for'
2019-09-21 17:11:29,918 Trac[mail] WARNING: EmailDistributor cannot send event 'ticket' as 'text/plain': email@abc.om

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 2 months ago

Resolution: cantfix
Status: newclosed

InstallationIssue.

You've installed a customized ticket_notify_email.txt in /var/data/trac/templates, however the template file is probably a Genshi template or wrong Jinja2 template. Trac 1.4 switched from Genshi to Jinja2 template engine.

You should correct the template file.

comment:2 by Ryan J Ollos, 2 months ago

Looks like we might need to update the example in the documentation: 1.3/TracNotification. And also mention the need to adapt Email templates in 1.3/TracUpgrade.

Last edited 2 months ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.