-
Notifications
You must be signed in to change notification settings - Fork 39
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
Can't connect to LDAP Server on Linux #136
Comments
Hi! Could you please provide the sample? What the type of auth do you use? |
Hi Sure @flamencist, I have tried using like this for authentication: connection.Bind(LdapAuthMechanism.SIMPLE, username, password); Strangely I am running into this issue since today morning on Windows if there are huge number of records at SendRequestAsync function:- LdapForNet.LdapUnavailableCriticalExtensionException: Unavailable Critical Extension. Unavailable Critical Extension. Result: 12. Method: ldap_parse_result. Details: ErrorMessage: 000020EF: SvcErr: DSID-03140594, problem 5010 (UNAVAIL_EXTENSION), data 0 I have tried for returning records for last few days instead of everything, it works on Windows then and fails on Linux stating this error: LdapForNet.LdapException: Can't contact LDAP server. Result: -1. Method: SearchRequest at LdapForNet.LdapConnection.ThrowIfResultError(DirectoryRequest directoryRequest, LdapResultType resType, DirectoryResponse directoryResponse) at LdapForNet.LdapConnection.ProcessResponse(DirectoryRequest directoryRequest, RequestHandler requestHandler, Int32 messageId, CancellationToken token) at LdapForNet.LdapConnection.<>c__DisplayClass24_0.b__0() At this line, var response = (SearchResponse)await connection.SendRequestAsync(directoryRequest); Is there any code sample available that works for linux as well, I believe it requires some configuration changes. |
Any update Sir @flamencist on this? |
I think that you have a huge count of records in ldap server. Try to use pagination control |
Tried using this, however it is failing at the first step of sendrequetasync. Not hitting the subsequent lines after it. LdapForNet.LdapUnavailableCriticalExtensionException: Unavailable Critical Extension. Unavailable Critical Extension. Result: 12. Method: ldap_parse_result. Details: ErrorMessage: 000020EF: SvcErr: DSID-03140594, problem 5010 (UNAVAIL_EXTENSION), data 0 This is the code snippet I am trying to use from the documentation of ldapfornet.
|
I mean other control
|
Hi @flamencist, Thanks I have tried this,
This always return 1000 records irrespective of what the pagesize is, is there anyway to override this functionality? The solution was to add:
Which I happen to find it from MSDN article link, Thanks a lot again, for guiding me through this issue. |
Hello Sir @flamencist, Back to the same error, when using pagination control. Any idea if we need any more configuration changes from our end?
This is the code snippet I am using currently:
|
Hi @flamencist, I have retried if it fails for the pagination and now I am encountering OutofMemory Exception.
|
Hello @AbhilashKopalli ! Perhaps it will help you |
I'm having a very similar problem on Linux (RHEL7) when trying to reuse connections. Everything is fine if I'm disposing every |
Not sure what happened, we upgraded to latest version since my last comment here, and the new exception is slightly different:
This is not the one and only exception we got. Seemingly randomly, sometimes the result is
As if it was some random memory corruption. But it gets worse. I created a project that runs my test suite infinitely until at least one test fails, and creates memory snapshots before and after each test using dotMemory profiling API. Even this modified test runner can repro the above exceptions... unless I run it with dotMemory because then the process runs ad infinitum without producing any errors. It sure looks like something with native code, the native interop or something else that can be influenced by the profiler. |
Update: I started investigation and might submit a PR if I find the root cause. I've found some issues around allocated buffers, but the errors didn't go away, only started occuring less frequently. |
Update 2: Using libldap_r-2.4 made the buffer overflow and "Can't contact LDAP server" errors completely go away! Since 2.4 is an old version (albeit included in RHEL7 by default) and the 2.5 LTS version integrates libldap_r into libldap, this might solve issue of these esotheric errors. Memory usage is still a problem with an infinitely growing unmanaged heap. |
Describe the bug
I am able to connect to LDAP Server in the wndows but through docker container when I am using Linux Platform I am getting this error stating that Can't connect to LDAP Server.
LdapForNet.LdapException: Can't contact LDAP server. Result: -1.
To Reproduce
It can be reproduced when we write a Dockerfile in linux environment.
Expected behavior
Make it cross-platform compatible
Desktop (please complete the following information):
Additional context
I have tried to install the necessary libraries for LDAP as well for linux.
apt-get update && apt-get install -y ldap-utils krb5-kdc-ldap libsasl2-2 libsasl2-modules sasl2-bin libsasl2-modules-ldap openssl
Let me know if I am missing on anything.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: