salt: [BUG] v3003 a salt-master using python 3.7+ using salt-ssh cannot work with a minion using python3.5 or 3.6
Setup install salt-ssh on an ubuntu 20.04 box and use it to control an ubuntu 16.04 box (probably happens with centos 7, 8, debian 9, and ubuntu 18.04 as well)
Steps to Reproduce the behavior
salt-ssh \* test.ping
minion-id:
----------
retcode:
1
stderr:
Traceback (most recent call last):
File "/var/tmp/.root_d24770_salt/salt-call", line 27, in <module>
salt_call()
File "/var/tmp/.root_d24770_salt/pyall/salt/scripts.py", line 437, in salt_call
import salt.cli.call
File "/var/tmp/.root_d24770_salt/pyall/salt/cli/call.py", line 6, in <module>
import salt.cli.caller
File "/var/tmp/.root_d24770_salt/pyall/salt/cli/caller.py", line 14, in <module>
import salt.loader
File "/var/tmp/.root_d24770_salt/pyall/salt/loader.py", line 7, in <module>
import contextvars
File "/var/tmp/.root_d24770_salt/py3/contextvars.py", line 1, in <module>
from _contextvars import Context, ContextVar, Token, copy_context
ImportError: No module named '_contextvars'
stdout:
I also tried doing pip3 install contextvars immutables --prefix /usr and pip3 install contextvars immutables on the master and it didn’t fix the issue.
Expected behavior
minion-id:
True
Versions Report
Salt Version:
Salt: 3003
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.10.1
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: 3.6.1
pygit2: Not Installed
Python: 3.8.5 (default, Jan 27 2021, 15:41:15)
python-gnupg: 0.4.5
PyYAML: 5.3.1
PyZMQ: 18.1.1
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.2
System Versions:
dist: ubuntu 20.04 focal
locale: utf-8
machine: x86_64
release: 5.4.0-70-generic
system: Linux
version: Ubuntu 20.04 focal
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 30 (13 by maintainers)
Commits related to this issue
- Use contextvars from site-packages for thin If a contextvars package exists one of the site-packages locations use it for the generated thin tarball. This overrides python's builtin contextvars and a... — committed to dwoz/salt by dwoz 3 years ago
- Add regression test for #59942 — committed to dwoz/salt by dwoz 3 years ago
- Add changelog for #59942 — committed to dwoz/salt by dwoz 3 years ago
- Use contextvars from site-packages for thin If a contextvars package exists one of the site-packages locations use it for the generated thin tarball. This overrides python's builtin contextvars and a... — committed to dwoz/salt by dwoz 3 years ago
- Add regression test for #59942 — committed to dwoz/salt by dwoz 3 years ago
- Add changelog for #59942 — committed to dwoz/salt by dwoz 3 years ago
- Use contextvars from site-packages for thin If a contextvars package exists one of the site-packages locations use it for the generated thin tarball. This overrides python's builtin contextvars and a... — committed to dwoz/salt by dwoz 3 years ago
- Add regression test for #59942 — committed to dwoz/salt by dwoz 3 years ago
- Add changelog for #59942 — committed to dwoz/salt by dwoz 3 years ago
- Use contextvars from site-packages for thin If a contextvars package exists one of the site-packages locations use it for the generated thin tarball. This overrides python's builtin contextvars and a... — committed to saltstack/salt by dwoz 3 years ago
- Add regression test for #59942 — committed to saltstack/salt by dwoz 3 years ago
- Add changelog for #59942 — committed to saltstack/salt by dwoz 3 years ago
- Merge Freeze into Master (#60074) * Merge 3002.6 bugfix changes (#59822) * Pass `CI_RUN` as an environment variable to the test run. This allows us to know if we're running the test suite under... — committed to saltstack/salt by Ch3LL 3 years ago
- Merge freeze into master (#60396) * Merge 3002.6 bugfix changes (#59822) * Pass `CI_RUN` as an environment variable to the test run. This allows us to know if we're running the test suite under... — committed to saltstack/salt by Ch3LL 3 years ago
The problem still exist with 3004! I’ve found a workaround, but maybe it’s not the right way to “solve” this:
First, i needed to include
typing_extensionsinto the thin package:And second, the harder part if running on Python 3.5 (yes, ugly…) is a bug in immutables which can be solved with this:
It will move the import of
NoReturninto the section which decides which version of Python is running, asNoReturnis not included in thetypingextension of Python 3.5Sorry for directly pasting diff’s here, but i never did a merge before so maybe someone here is able to do that 😃
Yes is present also in 3004
@sagetherage Given that at least two of us are finding this bug still to be present in 3003.1, please would you reopen this issue? TIA.
I’m also still seeing this with salt-ssh 3003.1 and Ubuntu 18.04 on a target machine.
closing as being released in Salt v3003.1 and will be merged forward into Master after the point release.
Ideally we’d be able to add a test for this in the regular test suite too. With the docker stuff in pytest we should probably be able to come up with something.