sometimes is not able to connect to the AD server #863

Closed
opened 2026-02-04 22:36:55 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @andreiM101 on GitHub (Oct 16, 2018).

Describe the bug
Sometimes I receive this error at login:
[2018-10-16 12:19:54] production.ERROR: ldap_bind(): Unable to bind to server: Can't contact LDAP server {"exception":"[object] (ErrorException(code: 0): ldap_bind(): Unable to bind to server: Can't contact LDAP server at /var/www/BookStack/app/Services/Ldap.php:93)
[stacktrace]

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to login page and fulfill the login credentials
  2. Click on login
  3. See error: in the screenshot:
    login error
  4. If I hit F5 and resend the login details it is connecting to the AD server and log me in.

Expected behavior
Log me in for the first time.

Screenshots
If applicable, add screenshots to help explain your problem.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.24.1
  • PHP Version: 7.2
  • Hosting Method (Nginx/Apache/Docker): Nginx

Additional context
It is not happening everytime.

Originally created by @andreiM101 on GitHub (Oct 16, 2018). **Describe the bug** Sometimes I receive this error at login: [2018-10-16 12:19:54] production.ERROR: ldap_bind(): Unable to bind to server: Can't contact LDAP server {"exception":"[object] (ErrorException(code: 0): ldap_bind(): Unable to bind to server: Can't contact LDAP server at /var/www/BookStack/app/Services/Ldap.php:93) [stacktrace] **Steps To Reproduce** Steps to reproduce the behavior: 1. Go to login page and fulfill the login credentials 2. Click on login 3. See error: in the screenshot: ![login error](https://user-images.githubusercontent.com/38532244/47016111-7334cc00-d157-11e8-8dd2-68cd8c6c6c29.jpg) 4. If I hit F5 and resend the login details it is connecting to the AD server and log me in. **Expected behavior** Log me in for the first time. **Screenshots** If applicable, add screenshots to help explain your problem. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v0.24.1 - PHP Version: 7.2 - Hosting Method (Nginx/Apache/Docker): Nginx **Additional context** It is not happening everytime.
Author
Owner

@matt-ttam commented on GitHub (Oct 17, 2018):

have you tried changing in .env LDAP_VERSION=false to LDAP_VERSION=3 or visa versa?
I found I the LDAP_DN value had to use the FQDN to work.
So for example if your domain is example.com and your AD connect user account is ad.connect then you put LDAP_DN=ad.connect@example.com

@matt-ttam commented on GitHub (Oct 17, 2018): have you tried changing in .env LDAP_VERSION=false to LDAP_VERSION=3 or visa versa? I found I the LDAP_DN value had to use the FQDN to work. So for example if your domain is example.com and your AD connect user account is ad.connect then you put LDAP_DN=ad.connect@example.com
Author
Owner

@andreiM101 commented on GitHub (Oct 17, 2018):

LDAP_VERSION is 3.
LDAP_DN was FQDN as in: CN=ad.connect,OU=Admins,OU=People,OU=EA,DC=example,DC=com
now I changed it in ad.connect@example.com as you suggest.
I'll keep an eye on it to see if the problem will be solved.

Thanks

@andreiM101 commented on GitHub (Oct 17, 2018): LDAP_VERSION is 3. LDAP_DN was FQDN as in: CN=ad.connect,OU=Admins,OU=People,OU=EA,DC=example,DC=com now I changed it in ad.connect@example.com as you suggest. I'll keep an eye on it to see if the problem will be solved. Thanks
Author
Owner

@andreiM101 commented on GitHub (Oct 18, 2018):

It did the same this morning.

@andreiM101 commented on GitHub (Oct 18, 2018): It did the same this morning.
Author
Owner

@matt-ttam commented on GitHub (Oct 20, 2018):

I have my LDAP_VERSION set to false, maybe try that. Have you got any aggressive antivirus/intrusion detection software set on the Active Directory server? It might be seeing the repeated connections and blocking access for a time period.
Here's my settings that got it working for me, connecting to Active Directory on Windows Server 2016.

LDAP_SERVER=192.168.1.10
LDAP_BASE_DN=ou=Staff,ou=SiteName,dc=example,dc=com
LDAP_DN=ldap_search@example.com
LDAP_PASS=password123
LDAP_USER_FILTER=(&(sAMAccountName=${user}))
LDAP_VERSION=false

@matt-ttam commented on GitHub (Oct 20, 2018): I have my LDAP_VERSION set to false, maybe try that. Have you got any aggressive antivirus/intrusion detection software set on the Active Directory server? It might be seeing the repeated connections and blocking access for a time period. Here's my settings that got it working for me, connecting to Active Directory on Windows Server 2016. LDAP_SERVER=192.168.1.10 LDAP_BASE_DN=ou=Staff,ou=SiteName,dc=example,dc=com LDAP_DN=ldap_search@example.com LDAP_PASS=password123 LDAP_USER_FILTER=(&(sAMAccountName=${user})) LDAP_VERSION=false
Author
Owner

@andreiM101 commented on GitHub (Oct 24, 2018):

The same configuration except LDAP_VERSION=3 as per documentation.
I'll change it and see if I have any change.

I don't think has anything to do with the configuration of the AD server because the error message is saying that it can't connect. So is more related to how the connection is handled not to the authentication.

Keep post the results.

@andreiM101 commented on GitHub (Oct 24, 2018): The same configuration except LDAP_VERSION=3 as per documentation. I'll change it and see if I have any change. I don't think has anything to do with the configuration of the AD server because the error message is saying that it can't connect. So is more related to how the connection is handled not to the authentication. Keep post the results.
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2019):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (May 18, 2019): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#863