Mailing List Archive

trac template errors - need urgent help
I have a production trac 1.4 server running on AWS ec2 AL2 which went crazy
an hour ago and I cannot figure out why. All trac pages produce template
errors, for example:

Traceback (most recent call last): File
"/usr/lib/python2.7/site-packages/trac/web/main.py", line 684, in
_send_error data, metadata) File
"/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1443, in
render_template fragment, iterable, method) File
"/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1497, in
_render_jinja_template domain) File
"/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1607, in
prepare_template template = self._load_jinja_template(filename, text) File
"/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1398, in
_load_jinja_template return (self.jenv_text if text else
self.jenv).get_template(filename) File
"/usr/lib/python2.7/site-packages/jinja2/environment.py", line 791, in
get_template return self._load_template(name, self.make_globals(globals))
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 765, in
_load_template template = self.loader.load(self, name, globals) File
"/usr/lib/python2.7/site-packages/jinja2/loaders.py", line 125, in load
code = environment.compile(source, name, filename) File
"/usr/lib/python2.7/site-packages/jinja2/environment.py", line 554, in
compile self.handle_exception(exc_info, source_hint=source) File
"/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in
handle_exception reraise(exc_type, exc_value, tb) File
"/usr/lib/python2.7/site-packages/trac/templates/error.html", line 118, in
template # set project_admin TemplateSyntaxError: expected token '=', got
'end of statement block'

I've attached a piece of the log for more info, any suggestions would be
greatly appreciated!

--
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 trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/b06e37d9-184f-48ca-ab6c-07c05a87eedbn%40googlegroups.com.
Re: trac template errors - need urgent help [ In reply to ]
This took a while to show on Google groups, and I was able to solve it in the mean time. The jinja2 lib was corrupted so a reinstall via pip fixed the issue. Still not sure what caused it though.

On 2/7/2024 10:28 AM, 'Ralph' via Trac Users wrote:

> I have a production trac 1.4 server running on AWS ec2 AL2 which went crazy an hour ago and I cannot figure out why. All trac pages produce template errors, for example:
>
> Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 684, in _send_error data, metadata) File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1443, in render_template fragment, iterable, method) File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1497, in _render_jinja_template domain) File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1607, in prepare_template template = self._load_jinja_template(filename, text) File "/usr/lib/python2.7/site-packages/trac/web/chrome.py", line 1398, in _load_jinja_template return (self.jenv_text if text else self.jenv).get_template(filename) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 791, in get_template return self._load_template(name, self.make_globals(globals)) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 765, in _load_template template = self.loader.load(self, name, globals) File "/usr/lib/python2.7/site-packages/jinja2/loaders.py", line 125, in load code = environment.compile(source, name, filename) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 554, in compile self.handle_exception(exc_info, source_hint=source) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python2.7/site-packages/trac/templates/error.html", line 118, in template # set project_admin TemplateSyntaxError: expected token '=', got 'end of statement block'
>
> I've attached a piece of the log for more info, any suggestions would be greatly appreciated!
> --
> You received this message because you are subscribed to a topic in the Google Groups "Trac Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/trac-users/6zoNSZKP_T0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit [https://groups.google.com/d/msgid/trac-users/b06e37d9-184f-48ca-ab6c-07c05a87eedbn%40googlegroups.com](https://groups.google.com/d/msgid/trac-users/b06e37d9-184f-48ca-ab6c-07c05a87eedbn%40googlegroups.com?utm_medium=email&utm_source=footer).

--
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 trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/3ae5a34a-77f9-481a-ae8b-e4fa75c12db8%40protonmail.com.