LDAP config ldap_initialize failed: Bad parameter to an ldap routine

Hello !

I need to sync my local seafile server with an LDAP server.

I try with 2 type of ldap serveur:

Active direcotry 2008R2

a first try to request with ldapsearch (since seafile serveur
ldapsearch -x -h 172.16.5.1 -D "caroot@corp.fr" -W -b “ou=service,dc=corp,dc=fr”

and the resquest work well .

in ccnet.conf I add:
[LDAP]
HOST = 172.16.5.1
BASE = OU=Services,DC=corp,DC=fr
USER_DN = caroot@corp.fr
PASSWORD = password
LOGIN_ATTR = mail

restart server then nothing append
in ccnet.log I can see:
[02/06/17 16:39:53] …/common/session.c(132): using config file /opt/seafile/conf/ccnet.conf
[02/06/17 16:39:53] …/common/session.c(455): socket file exists, delete it anyway
[02/06/17 16:39:53] …/common/session.c(484): Listen on /opt/seafile/ccnet/ccnet.sock for local clients
[02/06/17 16:39:53] …/common/session.c(290): Update pubinfo file
[02/06/17 16:39:53] …/common/connect-mgr.c(515): Opened port 10001 to listen for incoming peer connections
[02/06/17 16:39:54] …/common/session.c(398): Accepted a local client
[02/06/17 16:39:54] …/common/session.c(398): Accepted a local client
[02/06/17 16:39:54] …/common/session.c(398): Accepted a local client
[02/06/17 16:39:54] …/common/session.c(398): Accepted a local client
[02/06/17 16:39:58] …/common/session.c(398): Accepted a local client
[02/06/17 16:39:58] …/common/peer.c(943): Local peer down
[02/06/17 16:40:06] …/common/session.c(398): Accepted a local client
[02/06/17 16:40:06] user-mgr.c(242): ldap_initialize failed: Bad parameter to an ldap routine.
[02/06/17 16:40:06] user-mgr.c(447): Please check USER_DN and PASSWORD settings.


then I try witg an other ldap server (an open-ldap server)

ldapsearch -x -h 172.16.1.3 -D “cn=toto,dc=corp,dc=fr” -W -b “dc=cdg44,dc=fr”

work well

so in ccnet.conf
I try*
[LDAP]
HOST = ldap://172.16.1.3
BASE = ou=services,dc=corp,dc=fr
USER_DN = cn=toto,dc=corp,dc=fr
PASSWORD = azerty
LOGIN_ATTR = mail

restart sever and:

[02/06/17 17:02:36] …/common/session.c(132): using config file /opt/seafile/conf/ccnet.conf
[02/06/17 17:02:36] …/common/session.c(455): socket file exists, delete it anyway
[02/06/17 17:02:36] …/common/session.c(484): Listen on /opt/seafile/ccnet/ccnet.sock for local clients
[02/06/17 17:02:36] …/common/session.c(290): Update pubinfo file
[02/06/17 17:02:36] …/common/connect-mgr.c(515): Opened port 10001 to listen for incoming peer connections
[02/06/17 17:02:37] …/common/session.c(398): Accepted a local client
[02/06/17 17:02:37] …/common/session.c(398): Accepted a local client
[02/06/17 17:02:37] …/common/session.c(398): Accepted a local client
[02/06/17 17:02:37] …/common/session.c(398): Accepted a local client
[02/06/17 17:02:41] …/common/session.c(398): Accepted a local client
[02/06/17 17:02:41] …/common/peer.c(943): Local peer down
[02/06/17 17:02:54] …/common/session.c(398): Accepted a local client
[02/06/17 17:02:54] user-mgr.c(277): ldap_bind failed for user cn=toto,dc=corp,dc=fr: Invalid credentials.
[02/06/17 17:02:54] user-mgr.c(447): Please check USER_DN and PASSWORD settings.
[02/06/17 17:03:06] …/common/session.c(398): Accepted a local client
[02/06/17 17:03:06] user-mgr.c(277): ldap_bind failed for user cn=toto,dc=corp,dc=fr: Invalid credentials.
[02/06/17 17:03:06] user-mgr.c(361): Please check USER_DN and PASSWORD settings.

Who know what’s append ?
me not !

Thx for helping !

If you’re using Seafile server on Linux, you should use the following format for HOST:

HOST = ldap://172.16.5.1

If you meet password error, check whether you have a white space following the password in your config file.

1 Like