Closed cr1st1p closed 7 months ago
@cr1st1p You're hitting this regression: https://github.com/saltstack/salt/issues/60188#issuecomment-844469528. I've linked to the comment which contains the current workaround of downgrading Jinja2.
As @myii said, this is a regression. I'll close this issue.
Your setup
Formula commit hash / release tag
git master branch, commit hash d48bdde2c6919d73a79301f46ec058668d413aac
Versions reports (master & minion)
Salt Version: Salt: 3002.2
Dependency Versions: cffi: 1.14.6 cherrypy: Not Installed dateutil: 2.8.1 docker-py: 5.0.0 gitdb: 4.0.7 gitpython: 3.1.18 Jinja2: 3.0.1 libgit2: Not Installed M2Crypto: Not Installed Mako: 1.1.4 msgpack: 1.0.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: 2.20 pycrypto: Not Installed pycryptodome: 3.10.1 pygit2: Not Installed Python: 3.9.6 (default, Jun 30 2021, 10:22:16) python-gnupg: Not Installed PyYAML: 5.4.1 PyZMQ: 22.1.0 smmap: 4.0.0 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.3.4
System Versions: dist: manjaro 21.1.0 Pahvo locale: utf-8 machine: x86_64 release: 5.4.135-1-MANJARO system: Linux version: Manjaro Linux 21.1.0 Pahvo
Pillar / config used
Bug details
Describe the bug
Trying to run a state.highstate via salt-ssh, and among others, using this formula. I get an exception: ... [DEBUG ] In saltenv 'base', looking at rel_path 'openssh/libsaltcli.jinja' to resolve 'salt://openssh/libsaltcli.jinja' [DEBUG ] In saltenv 'base', considering path '/var/tmp/.root_9669d5_salt/running_data/var/cache/salt/minion/files/base/openssh/libsaltcli.jinja' to resolve 'salt://openssh/libsaltcli.jinja' [ERROR ] Rendering exception occurred Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/salt/utils/templates.py", line 495, in render_jinja_tmpl output = template.render(**decoded_context) File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception raise rewrite_traceback_stack(source=source) File "", line 1, in top-level template code File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1412, in make_module return TemplateModule(self, ctx) File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1542, in init body_stream = list(template.root_render_func(context)) # type: ignore File "/var/tmp/.root_9669d5_salt/running_data/var/cache/salt/minion/files/base/openssh/map.jinja", line 6, in top-level template code {%- from tplroot ~ "/libmapstack.jinja" import mapstack %} File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1412, in make_module return TemplateModule(self, ctx) File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1542, in init body_stream = list(template.root_render_func(context)) # type: ignore File "/var/tmp/.root_9669d5_salt/running_data/var/cache/salt/minion/files/base/openssh/libmapstack.jinja", line 6, in top-level template code {%- from tplroot ~ "/libmatchers.jinja" import parse_matchers, query_map %} File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1412, in make_module return TemplateModule(self, ctx) File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1542, in init body_stream = list(template.root_render_func(context)) # type: ignore File "/var/tmp/.root_9669d5_salt/running_data/var/cache/salt/minion/files/base/openssh/libmatchers.jinja", line 6, in top-level template code {%- from tplroot ~ "/libsaltcli.jinja" import cli %} File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1412, in make_module return TemplateModule(self, ctx) File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1542, in init body_stream = list(template.root_render_func(context)) # type: ignore File "/var/tmp/.root_9669d5_salt/running_data/var/cache/salt/minion/files/base/openssh/libsaltcli.jinja", line 5, in top-level template code {%- set opts_cli = opts.get('__cli', '') %} File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 474, in getattr return getattr(obj, attribute) jinja2.exceptions.UndefinedError: 'opts' is undefined
Steps to reproduce the bug
I guess just try using this formula and run it with salt-ssh.
Expected behaviour
To work correctly when running via salt-ssh as well. Note: months ago, when running it via salt-master/minion, it worked ok. But I want to run it now agentless.
Attempts to fix the bug
None.
Additional context
none