Skip to content
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

binding not released #12

Open
whitlockjc opened this issue Nov 15, 2015 · 1 comment
Open

binding not released #12

whitlockjc opened this issue Nov 15, 2015 · 1 comment

Comments

@whitlockjc
Copy link
Owner

I am using your script on CentOS 6. I got the following error when using your script more then once:
Error performing search: {'info': '00002024: LdapErr: DSID-0C060595, comment: No other operations may be performed on the connection while a bind is outstanding., data 0, v1772', 'desc': 'Server is busy'} It seems the binding is not released by your script. I added an unbind function. Since I'm unfamiliar with Bitbucket here are the relevant snippets.

# bind()
def unbind(ldapobject):
  ldapobject.unbind()
  if verbose:
    print("Released binding to %s..." % url)
# unbind()

Cheers, Jasper

@whitlockjc
Copy link
Owner Author

Unbind alone does not work since the server is busy. Adding a loop to retry when unbinding worked:

for i in range(1, 3):
  try:
    groups = search_for_groups(ldapobject)
    break
  except ldap.LDAPError, error_message:
    print("Error performing search: %s " % error_message)
  if i==3:
    unbind(ldapobject)
  sys.exit(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant