synapse icon indicating copy to clipboard operation
synapse copied to clipboard

consent resource generation fails with jinja < 2.9

Open ukcb opened this issue 8 years ago • 4 comments

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''

ukcb avatar May 27 '18 17:05 ukcb

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.

ukcb avatar May 28 '18 15:05 ukcb

select_autoescape was added in jinja 2.9, so I guess we should make sure we have that if the consent resource is enabled.

richvdh avatar Dec 21 '18 10:12 richvdh

This issue seems to be outdated. Python 2.7 and Synapse 0.30.

dklimpel avatar May 06 '22 17:05 dklimpel

Agreed, and the fix that Rich proposed was merged in #4327.

DMRobertson avatar May 07 '22 14:05 DMRobertson