Bug 57439 - repair univention-sync-memberuid
repair univention-sync-memberuid
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-8-errata
Assigned To: Marius Meschter
Christian Castens
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2024-07-09 10:37 CEST by Christina Scheinig
Modified: 2024-07-31 15:54 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.017
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2024070421000066
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2024-07-09 10:37:08 CEST
In a 5.0-8 environment, the group memberships are extremly mixed up.
Trying to fix this issue with running this nice script fails, because the script was not running at all. Introducing the new logging method, the script was tracebacking.

That fix, makes it running again.

--- /usr/share/univention-directory-manager-tools/univention-sync-memberuid     2024-06-24 12:50:00.000000000 +0200
+++ univention-sync-memberuid   2024-07-08 17:07:33.345255000 +0200
@@ -42,7 +42,7 @@
 import sys
 from argparse import ArgumentParser
 from logging import getLogger
-
+import logging
 import ldap

 import univention.config_registry
@@ -73,7 +73,7 @@

     options = parser.parse_args()

-    univention.logging.basicConfig(filename='/var/log/univention/sync-memberuid.log', univention_debug_level=options.debug)
+    logging.basicConfig(filename='/var/log/univention/sync-memberuid.log', level=options.debug)

     base_dn = configRegistry['ldap/base']

It would also be nice, if the logging writes timestamps in the logfile. So maybe we improve the script a little bit, maybe also with specification of groups, which should be fixed, instead of trying to fix everything, because in big environments this causes trouble in addition. 
BTW same with the proof_uniqueMembers script, which takes about 8 hours in this environment and is therefor not usable for the customer.
Comment 2 Marius Meschter univentionstaff 2024-07-25 16:55:36 CEST
univention-directory-manager-modules.yaml
e607d0373283 | fix(sync-memberuid): repair and modernize univention-sync-memberuid

univention-directory-manager-modules (15.0.27-4)
e607d0373283 | fix(sync-memberuid): repair and modernize univention-sync-memberuid

ucs-test (10.0.22-36)
e607d0373283 | fix(sync-memberuid): repair and modernize univention-sync-memberuid

The initial error could be fixed by simply importing univention.logging.
However I also added some modernization and features.
- Switched from using raw ldap connection to univention.admin.uldap
- Added include and exclude lists

Build:
Successful build
Package: univention-directory-manager-modules
Version: 15.0.27-4
Branch: 5.0-0
Scope: errata5.0-8

Successful build
Package: univention-directory-manager-modules
Version: 17.0.14
Branch: 5.2-0

Successful build
Package: ucs-test
Version: 10.0.22-36
Branch: 5.0-0
Scope: errata5.0-8

Successful build
Package: ucs-test
Version: 12.0.124
Branch: 5.2-0
Comment 3 Christian Castens univentionstaff 2024-07-25 17:36:26 CEST
QA:
OK: manual testing
  OK: `univention-sync-memberuid` syncs uniqueMember attribute to memberUID attribute
  OK: new flags -g and -x (create include and exclude lists)
OK: advisories
OK: code review
OK: new test
OK: build 5.0-8 and 5.2-0
Comment 4 Christian Castens univentionstaff 2024-07-31 15:54:29 CEST
<https://errata.software-univention.de/#/?erratum=5.0x1092>