Repository navigation
Closed
Labels
AluminiumRelease Post Mg and Pre SiRegressionThe issue is a bug that breaks functionality known to work in previous releases.Salt-SSHbugbroken, incorrect, or confusing behaviorcentosaffects this operating systemdebianaffects this operating systempoint-releaseminor releaseseverity-high2nd top severity, seen by most users, causes major problemsubuntuaffects this operating system
Milestone
Description
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
Reacted by Alexey Murz Korepov, xuhcc, Jerry Jones and Aaron
Metadata
Metadata
Assignees
Labels
AluminiumRelease Post Mg and Pre SiRegressionThe issue is a bug that breaks functionality known to work in previous releases.Salt-SSHbugbroken, incorrect, or confusing behaviorcentosaffects this operating systemdebianaffects this operating systempoint-releaseminor releaseseverity-high2nd top severity, seen by most users, causes major problemsubuntuaffects this operating system
Activity
[-][BUG] a salt-master using python 3.7+ using salt-ssh cannot work with a minion using python3.5 or 3.6[/-][+][BUG] v3003 a salt-master using python 3.7+ using salt-ssh cannot work with a minion using python3.5 or 3.6[/+]sagetherage commentedon Mar 31, 2021
@frogunder @Ch3LL if we don't have a test for this in the packaging tests we should consider adding something see internal slack conversation starting here: https://saltstack.slack.com/archives/C04HEQ97D/p1617221478334300 in releasediscussions
dwoz commentedon Mar 31, 2021
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.
bryceml commentedon Mar 31, 2021
probably a different issue, but I also see
as well with salt-ssh where I didn't before when running
salt-ssh \* state.single pkg.uptodate uptodate refresh=True dist_upgrade=Truedebug output
danmac-uk commentedon Apr 1, 2021
Can confirm with Debian 10 master, salt-ssh now fails with the contextvars error on Debian 9 target, as of the 3003 update. Debian 10 targets unaffected.
djneades commentedon Apr 1, 2021
This bug also occurs against a Ubuntu 18.04 target.
41 remaining items
blackzombie87 commentedon Nov 4, 2021
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 :)
drigolin commentedon Dec 13, 2021
Yes is present also in 3004
lastmikoi commentedon Jan 24, 2022
Thank you VERY much for that workaround, I was able to workaround my issue and start working on my 10-month froze deployment (rockylinux is only supported on >3004 so rolling back to 3002 was impossible), after I remembered to clean my .cache folder.
I can confirm that, without this workaround, the issue is still here, even with a python 3.6 archlinux virtualenv trying to salt-ssh to a python 3.6 rockylinux 8 target.
OrangeDog commentedon Jul 6, 2022
Reopening due to multiple reports of not being fixed.
lastmikoi commentedon Jul 7, 2022
Thanks for the re-opening @OrangeDog !
I've gone ahead and troubleshooted the issue in detail, I've worked on a fix (#62234) which seems to be functional.
As an excerpt of my troubleshooting, from the PR:
tao-devops commentedon Jul 29, 2022
as
fs30000 commentedon Dec 16, 2022
I had the the "ModuleNotFoundError: No module named 'contextvars'" error when connecting to a centos 7 machine using salt-ssh. Of course doing pip3 install contextvars on the target fixed it.
Reonaydo commentedon Mar 9, 2023
Why Salt puts contextvars.py from Python-3.7+ into archive? If on Python-3.7+ on target system it already has his own contextvars.py. But if target system has lesser version of Python than 3.7, this contextvars.py breaks it.
loader.py has support for 3.6 and 3.7+ versions in next code
So I think that salt mustn't put contextvars.py in thin.tgz
I think there should always be contextvars backport from PyPi instead(but I'm not sure how should it be put inside)
Python-3.7+ on target system will skip it in loader but legacy version will use this backported contextvars
I made this fast patch and is works for me for rhel7-based and rhel8-based systems if python3-contextvars is installed on those systems.
Reonaydo commentedon Mar 9, 2023
Oh I got it. contextvars exists in dependencies but was removed but my distro maintainers.
import typing_extensions for compatibility with hosts on python <3.8
dmurphy18 commentedon Jul 11, 2023
Closing this, since it appears to be fixed, please reopen if other points to raise