synapse
synapse copied to clipboard
consent resource generation fails with jinja < 2.9
I'm trying to configure the tracking agreement, but I only get errors.
debian stretch and matrix-synapse v0.30.0
2018-05-27 19:14:52,050 - twisted - 131 - ERROR - - Traceback (most recent call last):
2018-05-27 19:14:52,052 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
2018-05-27 19:14:52,053 - twisted - 131 - ERROR - - "__main__", fname, loader, pkg_name)
2018-05-27 19:14:52,053 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
2018-05-27 19:14:52,053 - twisted - 131 - ERROR - - exec code in run_globals
2018-05-27 19:14:52,054 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 528, in <module>
2018-05-27 19:14:52,054 - twisted - 131 - ERROR - - main()
2018-05-27 19:14:52,054 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 523, in main
2018-05-27 19:14:52,055 - twisted - 131 - ERROR - - hs = setup(sys.argv[1:])
2018-05-27 19:14:52,055 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 354, in setup
2018-05-27 19:14:52,056 - twisted - 131 - ERROR - - hs.start_listening()
2018-05-27 19:14:52,056 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 243, in start_listening
2018-05-27 19:14:52,056 - twisted - 131 - ERROR - - self._listener_http(config, listener)
2018-05-27 19:14:52,057 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 113, in _listener_http
2018-05-27 19:14:52,057 - twisted - 131 - ERROR - - config, name, res.get("compress", False),
2018-05-27 19:14:52,057 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 187, in _configure_named_resource
2018-05-27 19:14:52,058 - twisted - 131 - ERROR - - consent_resource = ConsentResource(self)
2018-05-27 19:14:52,058 - twisted - 131 - ERROR - - File "/usr/lib/python2.7/dist-packages/synapse/rest/consent/consent_resource.py", line 119, in __init__
2018-05-27 19:14:52,058 - twisted - 131 - ERROR - - autoescape=jinja2.select_autoescape(['html', 'htm', 'xml']),
2018-05-27 19:14:52,059 - twisted - 131 - ERROR - - AttributeError: 'module' object has no attribute 'select_autoescape''
Debian/stretch (stable) has no function select_autoescape in python-jinja2_2.8-1_all.deb. From Debian/buster (testing) the function is in python-jinja2_2.10-1_all.deb.
select_autoescape was added in jinja 2.9, so I guess we should make sure we have that if the consent resource is enabled.
This issue seems to be outdated. Python 2.7 and Synapse 0.30.
Agreed, and the fix that Rich proposed was merged in #4327.