question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client.bind() never responds if server can't be reached (timeouts have no effect)

See original GitHub issue

Long story short, if your server is currently down, a client.bind() never responds (meaning the callback is never called). Setting the connectTimeout and timeout on ldapjs.createClient() seem to have no effect at all here.

We first noticed this when a server went down after our app had already bound and the app then started hanging, so I’m assuming ldapjs was trying to re-bind after the connection fail[?]. I mention this because the knock on effect is that upstream client.search()s suddenly stop responding.

Reproducible like this, assuming the IP address here is valid but not responding:

> var ldapjs = require('ldapjs')
> var client = ldapjs.createClient({url:'ldap://10.146.241.10:1389', timeout:3000, connectTimeout:3000})
> client.bind(myDN, myPassword, function(err) { console.log('bind', err); });
> // ...tumbleweeds...

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
maneeshmohan2000commented, Feb 10, 2017

When the LDAP server is down and if I set the queueDisable option to false, this works fine and give me the error “{ [ConnectionError: connection unavailable] lde_message: 'connection unavailable ', lde_dn: null }”. But, this is always throwing the same error when the LDAP server is up also and if I comment out the queueDisabled option, it works. I am wondering why this is behaving like this.

1reaction
danperkscommented, Jul 20, 2021

Issue is still present now

Read more comments on GitHub >

github_iconTop Results From Across the Web

client.bind() never responds if server can't be reached ...
Setting the connectTimeout and timeout on ldapjs.createClient() seem to have no effect at all here. We first noticed this when a server went...
Read more >
Developers - client.bind() never responds if server can't be reached ...
client.bind() never responds if server can't be reached (timeouts have no effect) ... timeout on ldapjs.createClient() seem to have no effect at all...
Read more >
Artificially create a connection timeout error - Stack Overflow
My next attempt was to use Alexander's suggestion of connecting to a different port, e.g. 81 (on my own server though). That worked...
Read more >
8. Configuration Reference — BIND 9 9.18.8 documentation
conf will be present if rndc is being run from a remote host, but is not required if rndc is being run from...
Read more >
Common Timeouts effecting Web Services, HTTP and SOAP ...
This timeout usually only occurs in situations where the writes are lagging behind new requests. This can occur when a client has a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found