salt icon indicating copy to clipboard operation
salt copied to clipboard

Changes to MarkupSafe version 2.1.0 break salt-key

Open seandjones92 opened this issue 2 years ago • 0 comments

Description of the tech debt to be addressed, include links and screenshots

When running salt-key commands we get the following output on 3004.2:

[root@4c0a5bc0f3a0:0 /]# salt-key -L
Error: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.9/site-packages/markupsafe/__init__.py)

It looks like MarkupSafe removed soft_unicode in version 2.1.0 but the 3004.2 requirements don't pin a version of MarkupSafe: https://markupsafe.palletsprojects.com/en/2.1.x/changes/#version-2-1-0 https://github.com/saltstack/salt/blob/604c955718aa3622236e0c131731a7bb54beb825/requirements/base.txt#L4

When I reinstall MarkupSafe at version 2.0.1 there is no issue:

[root@4c0a5bc0f3a0:0 /]# salt-key -L
Error: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.9/site-packages/markupsafe/__init__.py)
[root@4c0a5bc0f3a0:0 /]# pip uninstall MarkupSafe
Found existing installation: MarkupSafe 2.1.1
Uninstalling MarkupSafe-2.1.1:
  Would remove:
    /usr/local/lib/python3.9/site-packages/MarkupSafe-2.1.1.dist-info/*
    /usr/local/lib/python3.9/site-packages/markupsafe/*
Proceed (Y/n)? y
  Successfully uninstalled MarkupSafe-2.1.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@4c0a5bc0f3a0:0 /]# pip install MarkupSafe==2.0.1
Collecting MarkupSafe==2.0.1
  Downloading MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Installing collected packages: MarkupSafe
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
flask 1.1.4 requires Jinja2<3.0,>=2.10.1, but you have jinja2 3.1.2 which is incompatible.
Successfully installed MarkupSafe-2.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@4c0a5bc0f3a0:0 /]# salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
Rejected Keys:

Versions Report

Salt Version: Salt: 3004.2

Dependency Versions: cffi: 1.15.1 cherrypy: Not Installed dateutil: 2.8.2 docker-py: Not Installed gitdb: 4.0.9 gitpython: 3.1.27 Jinja2: 2.10.3 libgit2: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack: 1.0.4 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: 2.21 pycrypto: Not Installed pycryptodome: 3.15.0 pygit2: Not Installed Python: 3.9.6 (default, Jul 29 2022, 22:18:05) python-gnupg: Not Installed PyYAML: 6.0 PyZMQ: 21.0.2 smmap: 5.0.0 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.3.3

System Versions: dist: centos 7 Core locale: utf-8 machine: x86_64 release: 5.10.104-linuxkit system: Linux version: CentOS Linux 7 Core

seandjones92 avatar Aug 02 '22 18:08 seandjones92