-
Notifications
You must be signed in to change notification settings - Fork 276
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
paged_search error with REUSABLE client_strategy in Active Directory #1152
Comments
if I recall correctly, the docs actually recommend against using even if you were to avoid your current issue, you might run into another with AD. AD has a limit on the number of cookies that can be live for a single authenticated client at once, and so if you have multiple paged searches executing in parallel then the newer ones will invalidate the cookies of the older ones before they complete |
Cannot find any mentions against using REUSABLE strategy in docs or issues. For now i do not expect AD-related issues, and if they arise, it will be regardless of the strategy used. Now I'm using the connection as stated in the docs: from ldap3 import REUSABLE, Connection
url = "ldap://addc:389"
user = "svcuser"
password = "pAsSword"
conn = Connection(
url,
user,
password,
auto_bind=True,
client_strategy=REUSABLE,
pool_size=4,
raise_exceptions=True,
)
search_params = {
"search_base": "OU=employees,DC=example,DC=com",
"search_filter": "(&(objectCategory=person)(objectClass=user)(|(userAccountControl:1.2.840.113556.1.4.803:=2)(&(!(accountExpires=0))(accountExpires<=133654332205528576))))",
"attributes": ["sAMAccountName", "mail"],
"paged_size": 1000,
"paged_criticality": True,
}
entries = conn.extend.standard.paged_search(**search_params)
for entry in entries:
print(entry) Maybe it is possible to get a specific free connection from the pool in order to use it exclusively in a request? |
|
When using SYNC strategy, i can successfully run
conn.extend.standard.paged_search(**search_params)
for finding disabled and expired users in Active Directory that normally returns ~18000 results (18 pages, 1000/per page).When i switch to REUSABLE strategy to reuse connections in my fastapi app, i get only 1000 results from the first page, and then this error raised:
ldap3.core.exceptions.LDAPUnavailableCriticalExtensionResult: LDAPUnavailableCriticalExtensionResult - 12 - unavailableCriticalExtension - None - 00000057: LdapErr: DSID-0C090B01, comment: Error processing control, data 0, v3839 - searchResDone - None
As far as I understand, this is due to the fact that a
paged_cookie
was received in one connection thread, and then there was an attempt to use it in another thread.The text was updated successfully, but these errors were encountered: