Upgrade to 2.2 errors with ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/omd/sites/sitename/local/lib/python3/urllib3/util/ssl_.py)

Currently 2.1.0p29
Ubuntu 22.04

CLI Error:
ImportError: cannot import name ‘DEFAULT_CIPHERS’ from ‘urllib3.util.ssl_’ (/omd/sites/sitename/local/lib/python3/urllib3/util/ssl_.py)

Apache Logs:
mod_wsgi (pid=6048): Failed to exec Python script file ‘/omd/sites/sitename/share/check_mk/web/app/index.wsgi’.

We have a distributed monitoring setup with 5 nodes. All are running the same OS and getting the same error when trying to upgrade to 2.2. When you run the update script in OMD it gives the error above but appears to “complete” and the visible http site show an error and the Apache logs show the above.

Any suggestions would be great.

Hallo,

have you found a solution? I have same error after upgrade to 2.2.

thank you!

Best regards

This is a problem of Python packages installed with pip3.
In this case the problem package should be “urllib3”
Since the major version increase of urllib3 to 2 in April you need to install urllib3 with

pip3 install 'urllib3<2' --upgrade

But you should also inspect the other local installed Python libraries at upgrade time.
What can help is to remove local installed libraries and reinstall these later after the upgrade. But the “downgrade” of urllib3 should help for this specific problem.
CMK 2.2 will not work with urllib3 v2.

1 Like

Thank you! It works!

How did you fix this? We have the exact same problem and nothing I try fixes it. As soon as we try to upgrade from 2.1 to 2.2 it bins out with the same error message you had, but the urllib command doesnt seem to help us.

Same here get the same error even after using the suggested as solution command, ubuntu 22.04 is the OS to upgrade to as an intermediate to get to 2.3 using ubuntu 24.04…