-
Notifications
You must be signed in to change notification settings - Fork 178
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
ldap3.core.exceptions.LDAPStartTLSError: automatic start_tls befored bind not successful #171
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Is it only the |
Sorry I can't tell because the JupyterHub docker container was freshly created without any fixed versions. I can do some digging there. I can say that the LDAPS server continues to work since a small script that directly imports the ldap package continues to work as intended. |
There were a few large PRs in the last release https://github.com/jupyterhub/ldapauthenticator/blob/master/CHANGELOG.md |
@1kastner did you make it work? i have the same problem. |
Well, @manics, I tried the following adjustment at the configuration to get more information:
But nothing showed up in the logs. I guess the reason is that maybe everything dies before the real action (exchange of information over network) even starts? Or were I missing something about the logs? I just checked the Jupyter logs that show up when I run The following script that uses vanilla ldap works:
|
@jrse I have several other jobs as well so if you want to take over to share some logs that help here, feel free to do so! If at some point I make it work I will let everyone know. |
Hi everyone, I have also the same problem. Running jupyterhub in debug mode does not give many more lines...
What I don't know, is where the IP |
At https://ldap3.readthedocs.io/en/latest/changelog.html they also mention that there were several changes just some days ago when a new library version has been published. At https://github.com/cannatag/ldap3/blob/191667cff76e874164dce94dafebf0acf344bd41/ldap3/core/connection.py#L391 we can see how the error message is created and there seem to be plenty of options what can go wrong. The changes at https://github.com/jupyterhub/ldapauthenticator/blob/master/ldapauthenticator/ldapauthenticator.py#L311 seem not that recent but the way LDAP interprets it has changed. If I have Therefore https://github.com/cannatag/ldap3/blob/191667cff76e874164dce94dafebf0acf344bd41/ldap3/core/connection.py#L250 is not a smart solution anymore because it relies on backward-compability. If This is just a quick static manual code analysis, the weather is hot, and I am not deeply rooted in any of the projects, so there might be flaws in my reasoning. But I believe https://github.com/jupyterhub/ldapauthenticator/blame/master/ldapauthenticator/ldapauthenticator.py#L312 needs some adjustments. |
I'll try redeploying my Jupyterhub and pinning ldap3 lib to 2.7 version to see if it works. Thanks for the analysis. |
@1kastner Thanks for investigating! One of the problems with LDAP is it can be extremely complex, and prior to the last release there were no CI tests which made maintainance very difficult. Thanks to #134 which added Travis tests this is much improved but unfortunately it looks like some bugs crept in. Would you mind opening a PR if you figure out the cause, and/or perhaps add a failing test case to https://github.com/jupyterhub/ldapauthenticator/blob/master/ldapauthenticator/tests/test_ldapauthenticator.py? Thanks! |
@manics I will see when I find time for it. If somebody else urgently needs a solution, better don't wait for me. |
Pinning ldap3 to 2.7 in the Python environment where the Jupyterhub is started did the trick for me. |
My quick analysis yesterday was faulty because of the behavior of the and/or operator:
which is equivalent to the more Pythonic version
|
Let's hope we will get some insights from the ldap3 developer team at cannatag/ldap3#855. |
Just for the complete picture: I did the same and it worked for me too. |
See jupyterhub#171 for further information
Ok, I have created a pull request for pinning the version. Once we have some feedback from the ldap3 developer team, we can see whether and how to adjust the code. If they intendedly broke something, it could get quite complex if both old and new library versions need to be supported. |
Hi, how did you select the version 2.7 for ldap3? I mean in which part do you specified the version to use? thanks for your help. |
It pretty much depends on how you run the JupyterHub. You don't even need to store it somewhere but instead just install the older ldap3 version manually where it is needed. If you use docker, you could for example take this JupyterHub Dockerfile and use pip to install the right version (see here) for how to fix a version.
|
Thanks for the insight, I was able to use version 2.7 for ldap3. |
I've just released https://pypi.org/project/jupyterhub-ldapauthenticator/1.3.1/ with @1kastner's PR to limit the version of |
Hi, sorry for these questions, I think these could be basic, but I am trying to install dockerspawner and I am able to do this via Dockerfile, but I have some questions about how I should configure JupyterHub in order to initialize the dockerspawner, not sure if this is something related to enable on jupyterhub_configuration file, any advise will be appreciated. Thanks. |
Hi, sorry for these questions, I think these could be very basic, but I am trying to install dockerspawner and I am able to do this via Dockerfile, but I have some questions about how I should configure JupyterHub in order to initialize the dockerspawner, not sure if this is something related to enable on jupyterhub_configuration file, any advise will be appreciated. Thanks. |
That is a bit unrelated to this issue. Please look at the corresponding github repos, check out the manuals, and if a question is left, you can always turn to https://discourse.jupyter.org/ |
Thanks @manics for that quick new release. For me the bug is fixed now. As soon as I get a response to cannatag/ldap3#855 I would discuss this in a separate issue if that is fine for everyone. |
At cannatag/ldap3#855 (comment) a solution is pointed out. |
See jupyterhub#171 for further information
See jupyterhub#171 for further information
Bug description
A JupyterHub configuration that has worked in the past stopped working after I have pulled the newest library versions.
Expected behaviour
My previous configuration continues to work.
Actual behaviour
LDAP login leads to the exception
ldap3.core.exceptions.LDAPStartTLSError: automatic start_tls befored bind not successful
with the following stacktraceHow to reproduce
I used the simple config lines:
Your personal set up
The text was updated successfully, but these errors were encountered: