Bug 53306 - 44_well_known_sid_check.py: error handling broken
44_well_known_sid_check.py: error handling broken
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - System diagnostic
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Maximilian Janßen
Florian Best
https://git.knut.univention.de/univen...
:
: 53900 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-21 10:07 CEST by Florian Best
Modified: 2022-02-16 12:06 CET (History)
4 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize, Error handling
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-05-21 10:07:55 CEST
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'
Comment 2 ITrash 2021-09-02 11:13:30 CEST
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'
Comment 3 ITrash 2021-09-02 11:18:47 CEST
This error has appeared in the system diagnostics. Caption is "Problem: Check 'Well Known' SIDs
Unfortunately, I am not able to reproduce this problem.
Comment 4 Maximilian Janßen univentionstaff 2022-01-12 17:30:35 CET
Merge request has been created: https://git.knut.univention.de/univention/ucs/-/merge_requests/238
Comment 5 Maximilian Janßen univentionstaff 2022-01-12 18:08:31 CET
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
Comment 6 Florian Best univentionstaff 2022-01-25 14:13:25 CET
OK: new error handling works
OK: YAML description
Comment 7 Florian Best univentionstaff 2022-01-28 17:18:09 CET
*** Bug 53900 has been marked as a duplicate of this bug. ***