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] salt-ssh 3005: no execution modules are available to any renderer #62636

Open
Rudd-O opened this issue Sep 8, 2022 · 5 comments
Open
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@Rudd-O
Copy link

Rudd-O commented Sep 8, 2022

I recently upgraded to 3005. None of the module functions are accessible under __salt__ in the pyobjects or in the jinja renderer — I just get a traceback now.

Pyobjects:

milena:
    - Rendering SLS backup.client.auth failed, render error: 
      Traceback (most recent call last):
        File "/usr/lib/python3.10/site-packages/salt/utils/pyobjects.py", line 286, in __getattr__
          return self._salt["{}.{}".format(mod, func)]
        File "/usr/lib/python3.10/site-packages/salt/loader/context.py", line 78, in __getitem__
          return self.value()[item]
        File "/usr/lib/python3.10/site-packages/salt/loader/lazy.py", line 336, in __getitem__
          super().__getitem__(item)  # try to get the item from the dictionary
        File "/usr/lib/python3.10/site-packages/salt/utils/lazy.py", line 105, in __getitem__
          raise KeyError(key)
      KeyError: 'cmd.run'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/usr/lib/python3.10/site-packages/salt/state.py", line 4135, in render_state
          state = compile_template(
        File "/usr/lib/python3.10/site-packages/salt/template.py", line 99, in compile_template
          ret = render(input_data, saltenv, sls, **render_kwargs)
        File "/usr/lib/python3.10/site-packages/salt/loader/lazy.py", line 149, in __call__
          return self.loader.run(run_func, *args, **kwargs)
        File "/usr/lib/python3.10/site-packages/salt/loader/lazy.py", line 1228, in run
          return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
        File "/usr/lib/python3.10/site-packages/salt/loader/lazy.py", line 1243, in _run_as
          return _func_or_method(*args, **kwargs)
        File "/usr/lib/python3.10/site-packages/salt/renderers/pyobjects.py", line 493, in render
          exec(final_template, _globals)
        File "<string>", line 15, in <module>
        File "/usr/lib/python3.10/site-packages/salt/utils/pyobjects.py", line 288, in __getattr__
          raise AttributeError
      AttributeError

Jinja:

milena:
    - Rendering SLS 'base:test' failed: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'cmd.run'; line 17
      
      ---
      [...]
        - name: |
            echo the value of skip_package_installs is {{ pillar.get('skip_package_installs') }}.
      
      test jinja run:
        test.nop:
        - name: "{{ salt['cmd.run']('hostname') }}"    <======================
      
      #bound:
      #  qubes.bind_dirs:
      #  - directories:
      #    - /abc
      ---
@Rudd-O Rudd-O added Bug broken, incorrect, or confusing behavior needs-triage labels Sep 8, 2022
@Rudd-O Rudd-O changed the title [BUG] salt-ssh 3005: no execution modules are available in the pyobjects renderer [BUG] salt-ssh 3005: no execution modules are available to any renderer Sep 8, 2022
@Rudd-O
Copy link
Author

Rudd-O commented Sep 8, 2022

This fixes it: #62635

@Rudd-O Rudd-O closed this as completed Sep 8, 2022
@Rudd-O Rudd-O reopened this Sep 12, 2022
@Rudd-O
Copy link
Author

Rudd-O commented Sep 12, 2022

The patch linked above does not fix this.

@eloquence
Copy link

As far as I can tell, this upstream bug broke our provisioning logic within Qubes OS, since we rely in a few places on Salt calls within Jinja syntax and suddenly started seeing similar errors after the 3005 update. Just a data point in case you're still assessing priority (for now downgrading Salt appears to resolve).

@eloquence
Copy link

@Rudd-O @MKLeb Would either of you be able to clarify the current status of this issue? Is the issue resolved in development (the final comments on the PR itself seem to suggest it is?), and if so, is a bugfix release of Salt planned for the near future?

@MKLeb
Copy link
Contributor

MKLeb commented Sep 14, 2022

@Rudd-O @MKLeb Would either of you be able to clarify the current status of this issue? Is the issue resolved in development (the final comments on the PR itself seem to suggest it is?), and if so, is a bugfix release of Salt planned for the near future?

This issue has been resolved and will be released in the next bugfix release, targeted soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

3 participants