[python-ldap] SERVER_DOWN: {'desc': "Can't contact LDAP server"} (no ssl)

Michael Ströder michael at stroeder.com
Thu Mar 12 21:46:28 CET 2015


Daniel Watrous wrote:
> I have the following class that creates an instance variable from
> ldap.initialize. There is a long running instance that is part of a web
> application. When first deployed, the app works as expected and connects to
> the LDAP directory and can run queries.
> [..]
> After running for some time however, self.ldapconn appears to go bad and I
> get this error:
> [..]
> SERVER_DOWN: {'desc': "Can't contact LDAP server"}

When using persistent connection you have to be prepared to handle this 
because servers might close connections after a while.

Basically that's what ReconnectLDAPObject is for:

http://www.python-ldap.org/doc/html/ldap.html#ldap.ReconnectLDAPObject

Make sure to use recent python-ldap release 2.4.19 to avoid running into bugs 
recently fixed.

Ciao, Michael.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4272 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20150312/40db09db/attachment.bin>


More information about the python-ldap mailing list