Univention Bugzilla – Bug 18501
Synchronisationsprobleme bei zu schnellen Änderungen im AD oder OpenLDAP
Last modified: 2021-02-01 20:53:40 CET
Bei den automatisierten Tests aufgefallen. Wenn eine Reihe von Änderungen im AD ohne Wartezeit gemacht werden, dann kann es vorkommen, dass eine gemachte Änderung aus dem UCS wieder ins AD zurück gespielt wird und somit Änderungen überschreibt. Das scheint ein konzeptionelles Problem zu sein, da die Synchronisation Objekt-basiert durchgeführt wird.
Tritt bspw. beim ad-connector-Testfall 21sync_create_and_modify_ad_user auf: Hier werden direkt hintereinander und während der Connector im Sync-Modus läuft auf AD-Seite mehrere Änderungen durchgeführt: - Anlegen eines Benutzerobjekts (mit etlichen Attributen) - für alle im Mapping eingetragenen Attribute wird anschließend an diesem Objekt der Wert geändert, jeweils durch eine einzelne LDAP-Anfrage Ganz am Ende, also erst nach all diesen Änderungen wird lange gewartet, bevor die Attributwerte verifiziert werden. Trotzdem ist anschließend ein Großteil der Attribute sowohl auf UCS als auch auf AD-Seite nicht erwartungsgemäß gesetzt. Abhilfe verschafft es lediglich, wenn man auch zwischen den einzelnen AD-Anweisungen ausreichend lange wartet
Tritt auch bei 57sync_ad_user_primarygroup auf
(In reply to comment #1) > Abhilfe verschafft es lediglich, wenn man auch zwischen den einzelnen > AD-Anweisungen ausreichend lange wartet Alternativ funktioniert das ganze auch, wenn während der ganzen Ad-Anweisungen der Connector gestoppt ist
(In reply to comment #2) > Tritt auch bei 57sync_ad_user_primarygroup auf Bei 61sync_ad_umlaut_user ebenfalls
Die in die Tests eingebauten Workarounds (zwischen den einzelnen Modifikationen am selben Objekt abwarten) nützen scheinbar erst ab w2k3 etwas. Mit w2k schlagen bspw. die beiden Tests 21read_create_and_modify_ad_user 21sync_create_and_modify_ad_user trotz einer Wartezeit von 16 Sekunden zwischen den einzelnen Modifikationen fehl. Außerdem treten bei w2k auch Probleme für die Tests mit Synchronisation in umgekehrter Richtung auf, bspw. 20sync_create_and_modify_ucs_user 20write_create_and_modify_ucs_user Hier ist noch kein Workaround in den Tests vorhanden.
(In reply to comment #5) > Die in die Tests eingebauten Workarounds (zwischen den einzelnen Modifikationen > am selben Objekt abwarten) nützen scheinbar erst ab w2k3 etwas. > > Mit w2k schlagen bspw. die beiden Tests > 21read_create_and_modify_ad_user > 21sync_create_and_modify_ad_user > trotz einer Wartezeit von 16 Sekunden zwischen den einzelnen Modifikationen > fehl. > > Außerdem treten bei w2k auch Probleme für die Tests mit Synchronisation in > umgekehrter Richtung auf, bspw. > 20sync_create_and_modify_ucs_user > 20write_create_and_modify_ucs_user > Hier ist noch kein Workaround in den Tests vorhanden. Diesen Kommentar bitte komplett ignorieren, hatte übersehen, dass Beschreibung von Benutzer und Gruppe unter win2000 standardmäßig nicht synchronisiert werden.
Siehe auch die Beschreibung aus Bug #3549: (In reply to comment #0) > Reproduktion: > netzwerkkabel am ad rechner abziehen (bei vm ethernet device deaktivieren) > benutzer auf ad loeschen > den selben benutzer auf ucs umbenennen > netzwerkkabel wieder anklemmen > der connector versucht den benutzer auf ucs zu loeschen und auf ad > umzubenennen, was nicht gehen kann, da er ja nicht mehr bzw. nicht mehr unter > dem selben Namen vorhanden ist. Folglich entsteht hier ein unterschied, den > der connector nicht aufloesen kann.
*** Bug 3549 has been marked as a duplicate of this bug. ***
*** Bug 15137 has been marked as a duplicate of this bug. ***
Siehe auch Bug #26515
Bei Samba4 ist die localUSN pro Attribut im Attribut replPropertyMetaData kodiert. Anschauen kann man sich das mit dem s4search-decode aus Bug 27752: univention-s4search ou=branch1 replPropertyMetaData | ./s4search-decode
reported by: 2013081521023638 S4-connector deletes a group that was deleted and recreated by UDM
Created attachment 6845 [details] 52_s4connector.320write_create_and_modify_ucs_user.test S4,Master UCS-3.2-5
Created attachment 8409 [details] Patch-Series implementing the "diff-mode". The attached patches port the the "diff-mode" changes from the s4-connector to the ad-connector. These changes depend upon and therefore include the patches from bug #36480 and bug #40813. The series contains several cleanup patches. These can be skipped without altering the behaviour. The `02*_concurrent*` tests were copied from the s4-connector tests and adapted. Those skipped with dependencies on unresolved bugs were not copied. These patches do not include the changes to the password `post_*_modify` functions as the password-sync function of both connectors differ and the password-sync functions in the ad-connector only write something if changes occured. All ad-connector tests are passing on a UCS 4.1-4 master with bidirectional sync with a Windows Server 2012 with german localization.
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4. If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Committed in r81434-r81445 (test r81447, advisory r81449).
I am not sure if this is the correct bug for my issue (to many bugs and changes in the ad connector for one QA round!). Problem. Windows AD (had to change password during first logon). UCS 4.1 with new connector. Windows AD Administrator password is not equal to UCS Administrator password. Configured AD connection (bidirectional). AD connection could be established and connector started. Got some weired tracebacks in connector.log (see attachment). Restarted connector. From now ony the connector could not start anymore. Turns out, that the connector synced the UCS Administrator password to AD but the connector still used the old password from /etc/univention/connector/ad/bindpw. I have never seen this before so i am pretty sure it has something to do with the current ad-connector changes.
Created attachment 9120 [details] connector-log - Administrator password issue
(In reply to Felix Botner from comment #17) > Turns out, that the connector synced the UCS Administrator password to AD > but the connector still used the old password from > /etc/univention/connector/ad/bindpw. Fixed in r82201, see bug #11658 comment 16.
Code-Review: Ok. For the upcomming UCS UCS 4.2-2 release I've cherrypicked the package to errata4.2-2 and re-built it there repo_admin.py --cherrypick \ --release 4.2-0 -s errata4.2-1 \ --releasedest 4.2-0 --dest errata4.2-2 \ --package univention-ad-connector b42-scope errata4.2-2 univention-ad-connector I've moved the advisory to ucs-4.2-2/doc/errata/staging and updated the version number. And I've reverted all SVN changes since the last released version from ucs-4.2-1/services/univention-ad-connector. r82640
7aa006c120cbd1cc5b72839f71a010d1aba40421 introduced the new mapping property option single_value and changed to connector code accordingly. This is basically an api change and may break setups with modified connector mappings. I think we should move this change at least to the next patch level update, or?
The patch for Bug 36480 depends on this one, so I reverted them too.
OK - d988473111172adea845ac9b1a81eea135c45c2d
It was not part of the voting process, so removing the target milestone.
I've merged the patches by Lukas with minor changes: 3b31040eee Bug #36480: ad-connector deduplicate UCS LDAP attribute values db8d6454b7 Bug #18501: ad-connector: copy s4cache.py->adcache.py from s4-connector e9f32c6fcf Bug #18501: ad-connector: cleanup adcache.py 7c9c8dcb82 Bug #18501: ad-connector: sync_{from,to}_ucs(): pass original object references bd1fd67c14 Bug #18501: ad-connector: maintain a cached version of the ad-object c7022814d0 Bug #18501: ad-connector: calculate and set `changed_attributes` 74cfb1a374 Bug #18501: ad-connector: use `changed_attributes` in `__set_value()` 4acac26c94 Bug #18501: ad-connector: cleanup `changed_attributes` in `__set_value()` 41bae45180 Bug #18501: ad-connector: introduce `single_value` in mapping.py 26ccba0912 Bug #18501: ad-connector: implement diff-mode in `sync_from_ucs()` de4d6e015f Bug #18501: Fix previous commit 4b760402b5 Bug #18501: Fix decoding of binary attribute values 39d13f8066 Bug #18501: ad-connector: remove _generate_dn_list() 7c1266802a Bug #18501: changelog On top of that I fixed the issue of Comment 21: c0e6de184f Bug #18501: Mark single_value attributes programmatically 5c30612270 Bug #18501: Log the mapping f7e9f5ac37 Bug #18501: changelog Successful build Package: univention-ad-connector Version: 13.0.0-37A~4.4.0.202006171858 Branch: ucs_4.4-0 Scope: errata4.4-4
9e63dc1b6e | Advisory
a38963fb55 | Don't mark attributes with con_other_attribute as single_value 3d9bcde13f | Fix handling of proxyAddresses mapping c130c0a0ae | Advisory Successful build Package: univention-ad-connector Version: 13.0.0-43A~4.4.0.202006222020 Branch: ucs_4.4-0 Scope: errata4.4-4
OK - diff mode (did only a few manual tests, no problems found except Bug #51564, but this was already broken before) OK - single_value from ldap schema OK - yaml OK - jenkins tests
<http://errata.software-univention.de/ucs/4.4/636.html>
FYI: it introduces Python 3 syntax errors: Setting up python3-univention-connector (14.0.0-3A~5.0.0.202007040333) ... File "/usr/lib/python3/dist-packages/univention/connector/adcache.py", line 173 except sqlite3.Error, exp: ^ SyntaxError: invalid syntax dpkg: error processing package python3-univention-connector (--configure): installed python3-univention-connector package post-installation script subprocess returned error exit status 1 dpkg: dependency problems prevent configuration of python3-univention-connector-ad: python3-univention-connector-ad depends on python3-univention-connector (= 14.0.0-3A~5.0.0.202007040333); however: Package python3-univention-connector is not configured yet. dpkg: error processing package python3-univention-connector-ad (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3-univention-connector python3-univention-connector-ad E: Sub-process /usr/bin/dpkg returned an error code (1)