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

Salt 3003.1 KeyError __runner__ #240

Closed
network-shark opened this issue Jun 30, 2021 · 4 comments
Closed

Salt 3003.1 KeyError __runner__ #240

network-shark opened this issue Jun 30, 2021 · 4 comments
Labels
Milestone

Comments

@network-shark
Copy link
Contributor

network-shark commented Jun 30, 2021

Good Morning @mirceaulinic ,

the latest salt updated briked salt sproxy again. If you need more logs. No problem.

Describe the bug
Salt sproxy does not run with latest salt version 3003.1

Steps To Reproduce
Create a virtual env with salt3003.1 and salt-sproxy

pip install netmiko napalm

Expected behavior
It should work :)

Versions Report
Print the output from salt-sproxy -V inside the backticks below:

Salt Version:
           Salt: 3003.1
    Salt SProxy: 2021.6.0

Dependency Versions:
        Ansible: Not Installed
           cffi: 1.14.5
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 3.0.1
     junos-eznc: 2.6.1
       jxmlease: Not Installed
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 1.0.2
         NAPALM: 3.3.1
       ncclient: 0.6.12
        Netmiko: 3.4.0
       paramiko: 2.7.2
      pycparser: 2.20
       pycrypto: Not Installed
   pycryptodome: 3.10.1
         pyeapi: 0.8.4
         pygit2: Not Installed
       PyNetBox: Not Installed
          PyNSO: Not Installed
         Python: 3.7.6 (default, Feb 28 2020, 14:34:05)
   python-gnupg: Not Installed
         PyYAML: 5.4.1
          PyZMQ: 22.1.0
            scp: 0.13.5
          smmap: Not Installed
        textfsm: 1.1.2
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.4
Package               Version
--------------------- ---------
bcrypt                3.2.0
certifi               2021.5.30
cffi                  1.14.5
chardet               4.0.0
ciscoconfparse        1.5.30
colorama              0.4.4
contextvars           2.4
cryptography          3.4.7
distro                1.5.0
dnspython             2.1.0
future                0.18.2
idna                  2.10
immutables            0.15
Jinja2                3.0.1
junos-eznc            2.6.1
lxml                  4.6.3
MarkupSafe            2.0.1
msgpack               1.0.2
napalm                3.3.1
ncclient              0.6.12
netaddr               0.8.0
netmiko               3.4.0
ntc-templates         2.1.0
paramiko              2.7.2
passlib               1.7.4
pip                   19.2.3
progressbar2          3.53.1
pycparser             2.20
pycryptodomex         3.10.1
pyeapi                0.8.4
PyNaCl                1.4.0
pyparsing             2.4.7
pyserial              3.5
python-utils          2.5.6
PyYAML                5.4.1
pyzmq                 22.1.0
requests              2.25.1
salt                  3003.1
salt-sproxy           2021.6.0
scp                   0.13.5
setuptools            41.2.0
six                   1.16.0
tenacity              7.0.0
textfsm               1.1.2
transitions           0.8.8
urllib3               1.26.6
yamlordereddictloader 0.4.0

Traceback

Exception occurred in runner proxy.execute: Traceback (most recent call last):
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/client/mixins.py", line 390, in low
    data["return"] = func(*args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 1241, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 2274, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 2289, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/py376/lib/python3.7/site-packages/salt_sproxy/_runners/proxy.py", line 1447, in execute
    rtargets_roster = roster_modules[roster](_tgt, tgt_type=_tgt_type)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 1241, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 2274, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 2289, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt_sproxy/_roster/file.py", line 40, in targets
    **kwargs
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/template.py", line 99, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 1241, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 2274, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader.py", line 2289, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/renderers/jinja.py", line 79, in render
    tmp_data.get("data", "Unknown render error in jinja renderer")
salt.exceptions.SaltRenderError: Traceback (most recent call last):
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/utils/templates.py", line 262, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/utils/templates.py", line 482, in render_jinja_tmpl
    decoded_context[key] = value.value()
  File "/home/myuser/.pyenv/versions/3.7.6/envs/salt3003-1/lib/python3.7/site-packages/salt/loader_context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__runner__'
@network-shark network-shark added bug Something isn't working pending triage labels Jun 30, 2021
@network-shark network-shark changed the title Salt sproxy 3003.1 KeyError __runner__ Salt 3003.1 KeyError __runner__ Jun 30, 2021
@mirceaulinic
Copy link
Owner

Thank you for reporting this @network-shark. I'll take a look soon and try to understand what's changed. Does it work fine with Salt 3003?

@mirceaulinic
Copy link
Owner

@network-shark could you try #241 and confirm it resolves the issue?

@mirceaulinic mirceaulinic added this to the 2021.6.1 milestone Jun 30, 2021
@network-shark
Copy link
Contributor Author

network-shark commented Jul 1, 2021

@mirceaulinic Wow that was quick . The patch is working . Thank you !

mirceaulinic added a commit that referenced this issue Jul 1, 2021
Fix #240: Salt 3003.1 KeyError __runner__
@mirceaulinic
Copy link
Owner

Released 2021.6.1 with this fix.

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

2 participants