Python-Fehlermeldung von Site seit Update auf 2.2.x

CMK version: 2.2.0.6
OS version: Debian Bullseye

Error message:

Seit dem Wechsel auf 2.2.x bekomme ich bei meinen Seiten die folgende Fehlermeldung beim Starten einer Seite:

Starting dcd…/omd/sites/gs/local/lib/python3/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (5.1.0)/charset_normalizer (2.0.7) doesn’t match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "

Updates wurden ganz normal per deb-Paket und omd update gemacht. Hat da jemand nen Tip für mich?

Dank & Grüße
Marcel

Hi @marcel_sch,

mal ins blaue geraten.
Welche MKP’s nutzt du bzw. hast du evtl. via pip redfish o.ä. installiert?

Ich könnte mir vorstellen, dass durch das installieren von pip Paketen, könnten sich die Checkmk Dependency’s geändert haben und nun hast du diese Meldung.

Mir ist mal etwas ähnliches auf einer Testsite passiert. Durch unachtsames installieren und entfernen von pip Paketen in der Site war das Checkmk “kaputt”. :sweat_smile:

Es kann natürlich auch etwas komplett anderes sein daher bitte mit Vorsicht genießen.

Gruß
Norm

Hallo ich habe das selbe Problem - ich habe einen Test auf check-mk-managed-2.2.0p12_0.bullseye durchgeführt.
Folgende Meldungen kommen bei der Installationsroutine:

Creating temporary filesystem /omd/sites/SITE/tmp…OK
Executing update-pre-hooks script “01_init_state_creation.py”…OK
Executing update-pre-hooks script “01_mkp-disable-outdated”…
-| [check_pcmeasure 1.1]: Not uninstalling
-| [icons 1.0]: Not uninstalling
-| [sms-massenversand-2 2.0]: Not uninstalling
-| [check_pcmeasure 1.1]: Updating from 1.1
-| [check_pcmeasure 1.1]: Installed
-| [icons 1.0]: Updating from 1.0
-| [icons 1.0]: Installed
-| [sms-massenversand-2 2.0]: Updating from 2.0
-| [sms-massenversand-2 2.0]: Installed
OK
Executing update-pre-hooks script “02_cmk-update-config”…
-| /omd/sites/SITE/local/lib/python3/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn’t match a supported version!
-| warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "
-| ATTENTION
-| Some steps may take a long time depending on your installation.
-| Please be patient.
-|
-| Verifying Checkmk configuration…
-| 01/04 Rulesets…
-| ‘check_mk --automation get-check-information’ returned '/omd/sites/SITE/local/lib/python3/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn’t match a supported version!
-| warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "
-| ’
-| ‘check_mk --automation get-section-information’ returned ‘/omd/sites/SITE/local/lib/python3/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn’t match a supported version!
-| warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "
-| ’
-| WARNING: Invalid rule configuration detected
-| Ruleset: logwatch_rules
-| Title: Logfile patterns
-| Folder: main
-| Rule nr: 7
-| Exception: Invalid regular expression: global flags not at the start of the expression at position 2
-|
-| You can abort the update process (A) and try to fix the incompatibilities with a downgrade to the version you came from or continue (c) the update.
-|
-| Abort update? [A/c]
c
-| 02/04 UI extensions…
-| 03/04 Agent based plugins…
-| 04/04 Deprecated .mk configuration of plugins…
-| Done (success)
-|
-| Updating Checkmk configuration…
-| 01/23 Validate user IDs…
-| 02/23 Update views…
-| 03/23 Update dashboards…
-| 04/23 Update reports…
-| 05/23 Update SAML Contact Group Settings…
-| 06/23 User attributes…
-| 07/23 Global settings…
-| 08/23 Update LDAP connection ids…
-| 09/23 Rulesets…
-| WARNING: Invalid rule configuration detected (Ruleset: logwatch_rules, Title: Logfile patterns, Folder: ,
-| Rule nr: 7, Exception: Invalid regular expression: global flags not at the start of the expression at position 2)
-| Detected 1 issue(s) in configured rules.
-| To correct these issues, we recommend to open the affected rules in the GUI.
-| Upon attempting to save them, any problematic fields will be highlighted.
-| 10/23 Autochecks…
-| 11/23 Remove unused host attributes…
-| 12/23 Convert persisted sections…
-| 13/23 Cleanup version specific caches…
-| 14/23 Background jobs…
-| 15/23 Extract remote sites CAs…
-| 16/23 Add a rule_id to each notification rule…
-| 17/23 Change absolute paths in registered hosts symlinks to relative…
-| 18/23 Remove old custom logos…
-| 19/23 Check for incompatible password hashes…
-| Users with outdated, no longer supported password hashes have been found. These users will be unable to log in.
-| Please manually reset these users’ passwords either in Setup > Users or on the commandline using the cmk-passwd command.
-| The following users are affected:
-| USERNAME@USERNAME
-| 20/23 Update licensing folders or settings…
-| Rename folder /omd/sites/SITE/var/check_mk/license_usage to /omd/sites/SITE/var/check_mk/licensing
-| Upgrade license usage report
-| No such instance id; create new one.
-| 21/23 Transform spool files…
-| 22/23 Update backup config…
-| 23/23 Update Agent Bakery…
-| Done (success)
OK
Updating core configuration…
/omd/sites/SITE/local/lib/python3/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.8) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn’t match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "
Generating configuration for core (type cmc)…
Starting full compilation for all hosts Creating global helper config…OK
Creating cmc protobuf configuration…OK
Finished update.

OMD[SITE]:~$ pip3 list --outdated | grep ‘urllib3|chardet|charset-normalizer’
chardet 5.1.0 - 5.2.0wheel
charset-normalizer 2.0.12 - 3.3.0 wheel
urllib3 1.26.8 - 2.0.7 wheel

wie bekommt man das am besten gefixt ohne das man die SITE zerschießt ?
Ich muss gestehen das ich mir nicht bewusst bin mit PIP da was installiert zuhaben… hmm

viele Grüße Sebastian

ls -lah local/lib/python3/

Hier darf nur der Ordner cmk angezeigt werden. Jeder weitere deutet auf ein installiertes Python-Modul hin. Diese einzeln deinstallieren

pip3 uninstall requests

Uninstall wird mehrere Versuche benötigen, wenn einzelne Pakete von anderen benötigt werden.

Folgendes taucht da auf:

bin/
certifi/
certifi-2021.10.8.dist-info/
charset_normalizer/
charset_normalizer-2.0.12.dist-info/
cmk/
idna/
idna-3.3.dist-info/
requests/
requests-2.27.1.dist-info/
urllib3/
urllib3-1.26.8.dist-info/

pip3 uninstall requests = DONE
pip3 uninstall idna = DONE

pip3 uninstall bin

WARNING: Ignoring invalid distribution -harset-normalizer (/opt/omd/sites/SITE/local/lib/python3)
WARNING: Ignoring invalid distribution -harset-normalizer (/opt/omd/sites/SITE/local/lib/python3)
WARNING: Skipping bin as it is not installed.

pip3 uninstall certifi

WARNING: Ignoring invalid distribution -harset-normalizer (/opt/omd/sites/SITE/local/lib/python3)
WARNING: Ignoring invalid distribution -harset-normalizer (/opt/omd/sites/SITE/local/lib/python3)
Found existing installation: certifi 2021.10.8
Uninstalling certifi-2021.10.8:
Would remove:
/opt/omd/sites/SITE/local/lib/python3/certifi-2021.10.8.dist-info/*
/opt/omd/sites/SITE/local/lib/python3/certifi/*
Proceed (Y/n)? Y
Successfully uninstalled certifi-2021.10.8

pip3 uninstall charset_normalizer

Found existing installation: charset-normalizer 2.0.12
Uninstalling charset-normalizer-2.0.12:
Would remove:
/opt/omd/sites/SITE/local/lib/python3/charset_normalizer-2.0.12.dist-info/*
/opt/omd/sites/SITE/local/lib/python3/charset_normalizer/*
/opt/omd/versions/2.1.0p33.cme/bin/normalizer
Proceed (Y/n)? Y
ERROR: Exception:
Traceback (most recent call last):
File “/omd/sites/SITE/lib/python3.9/shutil.py”, line 825, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: ‘/opt/omd/versions/2.1.0p33.cme/bin/normalizer’ → ‘/tmp/pip-uninstall-8pynx1ac/normalizer’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/omd/sites/SITE/lib/python3.9/site-packages/pip/_internal/cli/base_command.py”, line 167, in exc_logging_wrapper
status = run_func(*args)
File “/omd/sites/SITE/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py”, line 97, in run
uninstall_pathset = req.uninstall(
File “/omd/sites/SITE/lib/python3.9/site-packages/pip/_internal/req/req_install.py”, line 638, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File “/omd/sites/SITE/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py”, line 369, in remove
moved.stash(path)
File “/omd/sites/SITE/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py”, line 267, in stash
renames(path, new_path)
File “/omd/sites/SITE/lib/python3.9/site-packages/pip/_internal/utils/misc.py”, line 305, in renames
shutil.move(old, new)
File “/omd/sites/SITE/lib/python3.9/shutil.py”, line 846, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: ‘/opt/omd/versions/2.1.0p33.cme/bin/normalizer’

ls -lah local/lib/python3/

bin/
cmk/
‘~harset_normalizer’/
‘~harset_normalizer-2.0.12.dist-info’/

Gesund sieht das nicht aus…

ich hab dann nochmal update durchlaufen lassen die python Warnung sind verschwunden…
hmm

viele Grüße Sebastian

Das sieht sauber aus. Das Artifakt vom charset_normalizer würde ich manuell löschen und dann die Site neu starten. Das bin darf bleiben.

für mich stellt sich die Frage wo die python Module hergekommen sind… komisch…

Die hat irgendwer™ mal installiert. Vermutlich, weil ein aktiver Check Abhängigkeiten hatte. Da Certifi recht häufig aktualisiert wird, vermute ich Q4 2021.

und die Error Meldungen beim De/Installieren von charset_normalizer einfach ignorieren und die etwas wirren Ordner ‘~harset_normalizer’/ & ‘~harset_normalizer-2.0.12.dist-info’/ einfach löschen ?

Exakt

Und ich werde in der Entwicklung nachhaken, dass in die Update-Scripte künftig eine Prüfung auf selbst installierte Python-Module reinkommt und man ggf. das Update abbrechen und alles deinstallieren kann.

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.