-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loses connection to LDAP server after a while and needs to restart #18
Comments
I am running 1.2.1 but I had to do some minor adjustments (support ldap without tls and groups in, at least our, AD are not always lists but sometimes a single name). Other than that it is unmodified. I have tried to tinker with the reconnect parameters but I can't make it stable over more than a couple of days. |
hm.. sounds strange |
Ok so I have built an image from the dev branch and deployed in a lab cluster. I had to wait a day before the issue started but now I get a time out whenever I try to access
The only modification I have done is to disable the ldaps requirement since I do not have a proper CA for Active Directory in the lab. |
please increase the loglevel to debug (set environment variable |
I believe I have that.
|
Yep, your deployment seems OK. If everything is correct something like the following should be logged by the pod when trying to authenticate:
|
Sorry, was running on |
The lab has been running for a few days and now it times out when I try to access
|
I just tried again and here are the logs for it:
|
If I kill the pod and have Kubernetes recreate it, then it starts working again (for a day or two). The LDAP server is a vanilla Active Directory on Windows Server 2016 with minimal configuration. But it contains a very large directory with over 5k users inside the group. |
Hmm.. the ldap library should reconnect to the server, but someone mentioned that this might not work very well with active directory (ldapjs/node-ldapjs#498 (comment)). I'm going to have a look into this (probably recreate the ldap connection for every request) |
@juckerf In our company we have similar applications written on Spring framework. We use this class https://docs.spring.io/spring-ldap/docs/current/apidocs/org/springframework/ldap/core/support/LdapContextSource.html The Java applications that our team wrote with this class are working well with the same LDAP source with similar connection details. |
@ephracis @var-kar |
Yes I noticed that new parameter. Thanks a lot! Makes my life much easier. I will upgrade and deploy a lab today with the latest version and see how it goes. |
@juckerf ldapjs/node-ldapjs#498 Any solution on the core ldapjs library to this connection issue? Thank you. |
Been running the 1.3.0 for 2 days now and still not seeing any issue. I will let it run for a few more days but it usually shows up within 3 days, most often after only 1 day. Never seen it go for more than 3 days without an issue. So I am optimistic that 1.3.0 solves the issue. But I'll keep this issue open for a few more days until I am certain that it's solved. |
The problem is back. So in the logs I usually see this every 3 minutes:
But then last night that stopped and now when I try to access
|
@var-kar @ephracis |
Don't think we have changed anything.
|
Seems like the best option is to switch from ldapjs to https://github.com/ldapts/ldapts since that one is better maintained. How big of an undertaking would that be? Any plans on doing such a switch? |
I was already thinking about switching to ldapts, too. I was hoping that ldapjs maintenance gets picked up by someone, but the longer I think about I guess that we've no choice than to switch to ldapts. It shouldn't be a lot of work, but I'm very busy at the moment so it could take another couple weeks... |
@ephracis I finally found the time to switch to ldapts. |
There was a bug in v2.0.0 which lead to very similar symptoms. The bug has been identified and fixed in v2.0.1. Chances are that this problem is also resolved now. |
@juckerf Looks like I'm experiencing the same issue. I'm currently running 2.0.1. Authentication works fine, but after a while, the pod becomes unresponsive and gets restarted until it goes into a CrashLoopBackOff-state. |
@juckerf never mind, it was a misconfiguration in my part. The schema and port of the liveness probe had to be adjusted. |
After kube-ldap has been running for a while (a day or two I think) it starts to timeout when doing /auth.
If I delete the pod and wait for a new one to be created it works fine. Nothing shows up in the log even though I have debug enabled.
The text was updated successfully, but these errors were encountered: