LDAP Sync doesn't sync group membership

Hi Guys,

we have a Seafile Server Pro 7.0.9 (CentOS 7) running with LDAP Sync with the python LDAP package. (done as described in the seafile manual: /deploy_pro/ldap_group_sync.md)

The ccnet.conf is changed as described in the article to sync users and groups from specific OU:

USER_NAME = seafile
ID = specific ID
NAME = files.COMPANY.com
#SERVICE_URL = http://127.0.0.1:8000
SERVICE_URL = https://files.COMPANY.com

[Client]
PORT = 13419

[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = password
DB = ccnet_db
CONNECTION_CHARSET = utf8

[LDAP]
HOST = ldap://domaincontroller IP
BASE = OU=USER,DC=COMPANY,DC=com
USER_DN = seafile@COMPANY.com
PASSWORD = password
LOGIN_ATTR = userPrincipalName

[LDAP_SYNC]
ENABLE_GROUP_SYNC = true
GROUP_OBJECT_CLASS = group
SYNC_INTERVAL = 5
GROUP_MEMBER_ATTR = member
DEL_GROUP_IF_NOT_FOUND = yes

The sync of users and their passwords still works fine.
The sync of the groups worked once, but if we now change the membership of these groups they will not sync to the Seafile Server.

As described in the articel you can test the sync with a python script, which is giving the following output:

[01/20/2020 09:47:34] [DEBUG] using config file /opt/seafile/conf/ccnet.conf
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
    self.run()
  File "/opt/seafile/seafile-pro-server-7.0.9/pro/python/seafevents/ldap_syncer/                                                                                                                                                             
  ldap_sync.py", line 14, in run
    self.start_sync()
  File "/opt/seafile/seafile-pro-server-7.0.9/pro/python/seafevents/ldap_syncer/                                                                                                                                                             
  ldap_sync.py", line 29, in start_sync
    self.sync_data(data_db, data_ldap)
  File "/opt/seafile/seafile-pro-server-7.0.9/pro/python/seafevents/ldap_syncer/                                                                                                                                                             
  ldap_group_sync.py", line 386, in sync_data
    grp_dn_db.pop(k)
NameError: global name 'grp_dn_db' is not defined

We already reinstalled the pyhton-ldap package with no results…

Anyone an idea how to solve this?

Greetings

Can you try to use the latest version 7.0.13?

Going to try that today - thanks!

Actually fixed the problem, unexpected but thanks a lot!