dolibarr icon indicating copy to clipboard operation
dolibarr copied to clipboard

ldap to dolibarr sync throws error if user already exists

Open maxkreg opened this issue 2 years ago • 10 comments

Bug

Dolibarr is installed via Cloudron. Their ldap sync script calls sync_users_ldap2dolibarr.php.

In its first run, sync works fine. If I add another user to the LDAP server, the script remarks that the users synced before exist, that the new user does not and that it will create it (all good so far), and then it stalls with an error, revoking the newly synced user (see below). Is there anything I am doing wrong or is this expected bahaviour? Many thanks!

root@c8d9a4b7-94bc-4850-ade5-xxxxxxxxxxx:~# /usr/sbin/sync-users.sh ==> Syncing LDAP users into dolibarr ***** sync_users_ldap2dolibarr.php (16.0.1) pid=1048 ***** Mails sending disabled (useless in batch mode) ----- Synchronize all records from LDAP database: host=172.18.0.1 port=3002 login=cn=c8d9a4b7-94bc-4850-xxxxxxxxxxxxxxxx,ou=apps,dc=cloudron pass=******************************************************************************************************************************** DN to extract=ou=users,dc=cloudron Filter=(&(objectclass=user)) ----- To Dolibarr database: type=mysqli host=mysql port=3306 login=ee86bxxxxxxxxxxx database=ee86bfxxxxxxxxxxxx ----- Options: commitiferror=0 excludeuser= Mapped LDAP fields=cn,sn,givenName,username,telephonenumber,facsimiletelephonenumber,mobile,mail UserCreate # Mxxxxxxxxx Kxxxxxxxx: login=m.xxxxxxxxxxxx, fullname=Mxxxxxxx Kxxxxxxxxxxx --> -6 Benutzername m.kxxxxxxxxxx existiert bereits. UserCreate # test: login=test, fullname=test --> -6 Benutzername test existiert bereits. UserCreate # testi: login=test2, fullname=testi --> Created user id=29 login=test2 Einige Fehler wurden gefunden. Änderungen wurden rückgängig gemacht.

Environment Version

16.0.1

Environment OS

No response

Environment Web server

No response

Environment PHP

7.4.3

Environment Database

MySQL or MariaDB 8.0.30-0ubuntu0.20.04.2

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

No response

maxkreg avatar Nov 11 '22 14:11 maxkreg