salt: salt-ssh not working on remote hosts with python versions >3.8
Description of Issue
When trying to highstate a new Fedora 25 machine with Python 3.11 (currently latest in repo), I get the following error: “ImportError: cannot import name ‘Mapping’ from ‘collections’ (/usr/lib64/python3.10/collections/init.py)”
Setup
N/A - Errors with salt using Python module. I have no custom python scripts
Steps to Reproduce Issue
[root@morton ~]
# salt-ssh -i comms state.highstate
comms:
----------
_error:
Failed to return clean data
retcode:
1
stderr:
Traceback (most recent call last):
File "/var/tmp/.root_5a678c_salt/salt-call", line 27, in <module>
salt_call()
File "/var/tmp/.root_5a678c_salt/pyall/salt/scripts.py", line 426, in salt_call
import salt.cli.call
File "/var/tmp/.root_5a678c_salt/pyall/salt/cli/call.py", line 3, in <module>
import salt.cli.caller
File "/var/tmp/.root_5a678c_salt/pyall/salt/cli/caller.py", line 15, in <module>
import salt.minion
File "/var/tmp/.root_5a678c_salt/pyall/salt/minion.py", line 23, in <module>
import salt.client
File "/var/tmp/.root_5a678c_salt/pyall/salt/client/__init__.py", line 40, in <module>
import salt.utils.minions
File "/var/tmp/.root_5a678c_salt/pyall/salt/utils/minions.py", line 12, in <module>
import salt.auth.ldap
File "/var/tmp/.root_5a678c_salt/pyall/salt/auth/ldap.py", line 11, in <module>
from jinja2 import Environment
File "/var/tmp/.root_5a678c_salt/pyall/jinja2/__init__.py", line 6, in <module>
from markupsafe import escape
File "/var/tmp/.root_5a678c_salt/py3/markupsafe/__init__.py", line 13, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
stdout:
Versions Report
minion: None - Using salt-ssh to highstate a host over ssh. Remote host running fedora 35
master:
Salt Version:
Salt: 3004
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.1
libgit2: Not Installed
M2Crypto: 0.35.2
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.8 (default, Nov 18 2021, 10:07:16)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.4
System Versions:
dist: oracle 7.9
locale: UTF-8
machine: x86_64
release: 5.4.17-2136.300.7.el7uek.x86_64
system: Linux
version: Oracle Linux Server 7.9
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 16 (6 by maintainers)
@HappyBuzzCut I was able to sidestep this by pip installing MarkupSafe 2.0.0 on my salt-ssh master which runs py 3.6. Do be sure to clear out the
/var/cache/salt/master
files of your salt-ssh master though. Didn’t work until I did that.