Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] state salt.minion failing if config version not present #540

Open
vveliev-tc opened this issue Aug 10, 2022 · 0 comments
Open

[BUG] state salt.minion failing if config version not present #540

vveliev-tc opened this issue Aug 10, 2022 · 0 comments
Labels

Comments

@vveliev-tc
Copy link

Your setup

Formula commit hash / release tag

v1.11.0

Versions reports (master & minion)

Salt Version:
Salt: 3004.2

Dependency Versions:
cffi: 1.15.1
cherrypy: Not Installed
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.5
gitpython: 3.1.14
Jinja2: 2.11.3
libgit2: 1.4.1
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.0
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: 1.9.0
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
python-gnupg: Not Installed
PyYAML: 5.3.1
PyZMQ: 20.0.0
smmap: 4.0.0
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4

System Versions:
dist: debian 11 bullseye
locale: utf-8
machine: x86_64
release: 5.10.0-15-cloud-amd64
system: Linux
version: Debian GNU/Linux 11 bullseye

Pillar / config used

salt:
  release: '3004'
  py_ver: 'py3'

Bug details

Describe the bug

when executing minion state it's failing:

/home/vveliev# salt-call state.sls salt.minion
[INFO    ] Loading fresh modules for state activity
[ERROR   ] Rendering exception occurred
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 502, in render_jinja_tmpl
    output = template.render(**decoded_context)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 74, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'version'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 261, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 509, in render_jinja_tmpl
    raise SaltRenderError("Jinja variable {}{}".format(exc, out), buf=tmplstr)
salt.exceptions.SaltRenderError: Jinja variable 'dict object' has no attribute 'version'
[CRITICAL] Rendering SLS 'feat/salt-test:salt.minion' failed: Jinja variable 'dict object' has no attribute 'version'

Steps to reproduce the bug

run salt-call state.sls salt.minion without setting version

Expected behaviour

expecting for miniuon to be configured just as state.sls salt.master

Attempts to fix the bug

Additional context

after checking sls files, it looks like master and minion do have different code for figuring out version where master actually checks if version is defined or not before attempting to use it

@vveliev-tc vveliev-tc added the bug label Aug 10, 2022
@vveliev-tc vveliev-tc changed the title [BUG] state salt.minion failing if no config:version missing [BUG] state salt.minion failing if config version not present Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant