Univention Bugzilla – Bug 53306
44_well_known_sid_check.py: error handling broken
Last modified: 2022-02-16 12:06:50 CET
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 152, in check_existence_and_consistency actual_name = ldap_connection.get_by_sid(sid) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 111, in get_by_sid raise KeyError(sid) KeyError: 'S-1-5-32-554' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/__init__.py", line 280, in execute result = execute(umc_module, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 175, in run check_errors = list(check_existence_and_consistency()) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 156, in check_existence_and_consistency yield SIDNotFound(error.message, mapped_name) AttributeError: 'KeyError' object has no attribute 'message'
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 152, in check_existence_and_consistency actual_name = ldap_connection.get_by_sid(sid) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 111, in get_by_sid raise KeyError(sid) KeyError: 'S-1-5-21-492777298-2643065075-631763082-501' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/__init__.py", line 280, in execute result = execute(umc_module, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 175, in run check_errors = list(check_existence_and_consistency()) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/44_well_known_sid_check.py", line 156, in check_existence_and_consistency yield SIDNotFound(error.message, mapped_name) AttributeError: 'KeyError' object has no attribute 'message'
This error has appeared in the system diagnostics. Caption is "Problem: Check 'Well Known' SIDs Unfortunately, I am not able to reproduce this problem.
Merge request has been created: https://git.knut.univention.de/univention/ucs/-/merge_requests/238
The Python3 migration forgot to replace the "message" attribute of exceptions. This has been replaced with a Python3 compatible method at 3 locations. I found the same error at 2 more places and fixed it there as well. univention-management-console-module-diagnostic.yaml 4fbef3800e42 | Bug #53306: yaml c990a9e6ef05 | Bug #53306: fix python3 compatability of exception handling univention-management-console-module-diagnostic (6.0.0-17) c990a9e6ef05 | Bug #53306: fix python3 compatability of exception handling
OK: new error handling works OK: YAML description
*** Bug 53900 has been marked as a duplicate of this bug. ***
<https://errata.software-univention.de/#/?erratum=5.0x225>