LDAP search not working


I’ve set up Seafile 6.2.2 with LDAP authentification and the users can log in, but when searching for other users to share to, the following error occurs and no results are returned:

2017-10-24 16:58:39,980 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /api2/search-user/
Traceback (most recent call last):
File “/data/seafile/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py”, line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/data/seafile/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/views/decorators/csrf.py”, line 58, in wrapped_view
return view_func(*args, **kwargs)
File “/data/seafile/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/views/generic/base.py”, line 71, in view
return self.dispatch(request, *args, **kwargs)
File “/data/seafile/seafile-server-6.2.2/seahub/thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/views.py”, line 466, in dispatch
response = self.handle_exception(exc)
File “/data/seafile/seafile-server-6.2.2/seahub/thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/views.py”, line 463, in dispatch
response = handler(request, *args, **kwargs)
File “/data/seafile/seafile-server-6.2.2/seahub/seahub/api2/endpoints/search_user.py”, line 109, in get
email_list += search_user_from_ccnet(q)
File “/data/seafile/seafile-server-6.2.2/seahub/seahub/api2/endpoints/search_user.py”, line 192, in search_user_from_ccnet
all_ldap_users = ccnet_api.search_ldapusers(q, 0, 10 - count)
File “/data/seafile/seafile-server-6.2.2/seafile/lib64/python2.6/site-packages/seaserv/api.py”, line 798, in search_ldapusers
return ccnet_threaded_rpc.search_ladpusers(keyword, start, limit)
AttributeError: ‘CcnetThreadedRpcClient’ object has no attribute ‘search_ladpusers’

I have just tested searching ldap users when sharing library on Seafile 6.2.2, but there is no problem. I don’t know why this error occurred on your system, could you reinstall Seafile and test it again?

I’ve just noticed that there is a typo in the function search_ladpusers (lapd instead of ldap). Can you please check if its the same on your side?

Yes, that’s it, replacing search_ladpusers with search_ldapusers fixed the problem.

Since i haven’t modified any files, this must be present in the distribution.

Yes, we have reproduced this problem, thanks for reporting.