On Monday, June 25, 2018 at 11:34:02 AM UTC-7, Brian G wrote:
>
> Trac 1.2.2 on running off local Ubuntu 16.04 machine via Apache2 and 
> nginx. 
>
> I'm working on enabling email notifications for comments and updates on 
> tickets. I followed the installation guide and it will not work. When I 
> comment on a ticket, this is the relevant part of the log presented. The 
> rest of the log consisted of loading plugins so I left it off for clarity.
>
>
>
> 2018-06-25 13:09:22,623 Trac[api] DEBUG: action controllers for
> ticket workflow: ['ConfigurableTicketWorkflow']
>
> 2018-06-25 13:09:22,646 Trac[api] DEBUG: Adding (None [0]) for 'always' 
> on rule
> (CarbonCopySubscriber) for (email)
>
> 2018-06-25 13:09:22,647 Trac[api] DEBUG: Adding (admin [1]) for 'always' 
> on
> rule (TicketUpdaterSubscriber) for (email)
>
> 2018-06-25 13:09:22,648 Trac[mail] DEBUG: EmailDistributor has found the
> following formats capable of handling 'email' of 'ticket': text/plain
>
> 2018-06-25 13:09:22,653 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 366, in distribute
>
>     outputs[fmt] = formatter.format(transport, fmt, event)
>
>   File
> "/usr/local/lib/python2.7/dist-packages/trac/ticket/notification.py",
> line 201, in format
>
>     return self._format_plaintext(event)
>
>   File 
> "/usr/local/lib/python2.7/dist-packages/trac/ticket/notification.py",
> line 204, in _format_plaintext
>
>     notify = TicketNotifyEmail(self.env)
>
>   File
> "/usr/local/lib/python2.7/dist-packages/trac/ticket/notification.py",
> line 505, in __init__
>
>     super(TicketNotifyEmail, self).__init__(env)
>
>   File
> "/usr/local/lib/python2.7/dist-packages/trac/notification/compat.py",
> line 100, in __init__
>
>     super(NotifyEmail, self).__init__(env)
>
>   File
> "/usr/local/lib/python2.7/dist-packages/trac/notification/compat.py",
> line 49, in __init__
>
>     method='text')
>
>   File
> "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line
> 1081, in load_template
>
>     return self.templates.load(filename, cls=cls)
>
>   File
> "/usr/lib/python2.7/dist-packages/genshi/template/loader.py", line
> 236, in load
>
>     filename, encoding=encoding)
>
>   File
> "/usr/lib/python2.7/dist-packages/genshi/template/loader.py", line
> 274, in _instantiate
>
>     allow_exec=self.allow_exec)
>
>   File
> "/usr/lib/python2.7/dist-packages/genshi/template/text.py", line 138,
> in __init__
>
>     loader=loader, encoding=encoding, lookup=lookup)
>
>   File
> "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 419,
> in __init__
>
>     self._stream = self._parse(source, encoding)
>
>   File
> "/usr/lib/python2.7/dist-packages/genshi/template/text.py", line 231,
> in _parse
>
>     lookup=self.lookup):
>
>   File
> "/usr/lib/python2.7/dist-packages/genshi/template/interpolation.py",
> line 82, in interpolate
>
>     pos[2] + (err.offset or 0))
>
> TemplateSyntaxError: invalid syntax (, line 1)
> (/var/www/trac/test/templates/ticket_notify_email.txt, line 13)
>
> 2018-06-25 13:09:22,653 Trac[mail] DEBUG: EmailDistributor is sending 
> event as
> 'text/plain' to: *email* <[email protected]>
>
> 2018-06-25 13:09:22,653 Trac[mail] WARNING: EmailDistributor cannot send 
> event
> 'ticket' as 'text/plain': *email* <[email protected]>
>
> 2018-06-25 13:09:22,654 Trac[web_ui] DEBUG: Side effect for
> ConfigurableTicketWorkflow
>
>
>
> Here is my notification setting in trac.ini
>
>
> [notification]
>
> always_notify_owner = true
>
> always_notify_updater = true
>
> default_format.email = text/plain
>
> mime_encoding = base64
>
> smtp_enabled = enabled
>
> smtp_from = [email protected] <[email protected]>
>
> smtp_from_name = "Full Name"
>
> smtp_password = *password*
>
> smtp_port = 587
>
> smtp_replyto = [email protected] <[email protected]>
>
> smtp_server = smtp.gmail.com
>
> smtp_subject_prefix = []
>
> smtp_user = *email* <[email protected]>
>
> use_tls = enabled
>
>
> From what I can gather from the log, it seems to be an issue with 
> formatting the ticket to email it.
>

You've added a custom notification template: 
$ENV/templates/ticket_notify_email.txt 

There appears to be a syntax error in that template. Please share the 
custom template and let us know what customization you are trying to make.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to