1
votes

Not able to authenticate Askbot django application on Ubantu 18.04

Able to ping the LDAP server, but still it says - "Can't contact LDAP server"

Error logs shows:-

Traceback (most recent call last): File "/srv/askbot/venv/local/lib/python2.7/site-packages/askbot/deps/django_authopenid/ldap_auth.py", line 127, in ldap_authenticate_default get_attrs File "/srv/askbot/venv/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 854, in search_s return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout) File "/srv/askbot/venv/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 847, in search_ext_s msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit) File "/srv/askbot/venv/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 843, in search_ext timeout,sizelimit, File "/srv/askbot/venv/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 331, in _ldap_call reraise(exc_type, exc_value, exc_traceback) File "/srv/askbot/venv/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 315, in _ldap_call result = func(*args,**kwargs) SERVER_DOWN: {u'info': 'Transport endpoint is not connected', 'errno': 107, 'desc': u"Can't contact LDAP server"}

1

1 Answers

1
votes

Ping uses the ICMP protocol. LDAP uses a TCP connection to (usually) port 389 (or 636 for LDAPS). Those are two different things.

So the fact that you can ping the server only means the server is online. It doesn't mean that the LDAP service is running or that a firewall is not blocking TCP traffic to the right port.

You can test opening a TCP connection to the right port on Ubuntu in one of two ways:

telnet yourserver 389

Or,

nmap yourserver 389

More information on that here.

You may have to install telnet or nmap for those to work. And if you're using LDAPS (LDAP over SSL) then you should test port 636.