ldapcherry icon indicating copy to clipboard operation
ldapcherry copied to clipboard

ldapcherryd command execution error

Open yule-sun opened this issue 5 years ago • 4 comments

[root@ZZ-LDAP01 ~]# /usr/local/bin/ldapcherryd Traceback (most recent call last): File "/usr/local/bin/ldapcherryd", line 11, in load_entry_point('ldapcherry==1.1.1', 'console_scripts', 'ldapcherryd')() File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2852, in load_entry_point return ep.load() File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2443, in load return self.resolve() File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2449, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/init.py", line 20, in from ldapcherry.exceptions import * File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/exceptions.py", line 9, in import cherrypy File "/usr/local/lib/python2.7/site-packages/CherryPy-17.4.2-py2.7.egg/cherrypy/init.py", line 66, in from ._cperror import ( File "/usr/local/lib/python2.7/site-packages/CherryPy-17.4.2-py2.7.egg/cherrypy/_cperror.py", line 129, in from more_itertools import always_iterable File "build/bdist.linux-x86_64/egg/more_itertools/init.py", line 1, in File "/usr/local/lib/python2.7/site-packages/more_itertools-7.2.0-py2.7.egg/more_itertools/more.py", line 340 def _collate(*iterables, key=lambda a: a, reverse=False):

How to fix it ,please

yule-sun avatar Nov 05 '19 07:11 yule-sun

Configuration error, wrong credentials, unable to connect to ldap with 'cn=Manager,dc=ldap,dc=idpbg,dc=com' uncaught exception: [{'desc': u'Invalid credentials'}] Python Exception: Traceback (most recent call last):

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/exceptions.py", line 229, in ret return func(self, *args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/init.py", line 895, in login auth = self._auth(login, password)

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/init.py", line 356, in _auth ret1 = self.backends[b].auth(user, password) or ret1

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/backend/backendLdap.py", line 402, in auth binddn = self._get_user(self._byte_p2(username), NO_ATTR)

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/backend/backendLdap.py", line 315, in _get_user r = self._search(self._byte_p2(user_filter), attrs, self.userdn)

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/backend/backendLdap.py", line 275, in _search ldap_client = self._bind()

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/backend/backendLdap.py", line 247, in _bind self._exception_handler(e)

File "/usr/local/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/backend/backendLdap.py", line 244, in _bind ldap_client.simple_bind_s(self.binddn, self.bindpassword)

File "/usr/local/lib/python2.7/site-packages/python_ldap-3.2.0-py2.7-linux-x86_64.egg/ldap/ldapobject.py", line 446, in simple_bind_s resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)

File "/usr/local/lib/python2.7/site-packages/python_ldap-3.2.0-py2.7-linux-x86_64.egg/ldap/ldapobject.py", line 751, in result3 resp_ctrl_classes=resp_ctrl_classes

File "/usr/local/lib/python2.7/site-packages/python_ldap-3.2.0-py2.7-linux-x86_64.egg/ldap/ldapobject.py", line 758, in result4 ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)

File "/usr/local/lib/python2.7/site-packages/python_ldap-3.2.0-py2.7-linux-x86_64.egg/ldap/ldapobject.py", line 331, in _ldap_call reraise(exc_type, exc_value, exc_traceback)

File "/usr/local/lib/python2.7/site-packages/python_ldap-3.2.0-py2.7-linux-x86_64.egg/ldap/ldapobject.py", line 315, in _ldap_call result = func(*args,**kwargs)

INVALID_CREDENTIALS: {'desc': u'Invalid credentials'}

yule-sun avatar Nov 08 '19 01:11 yule-sun

Not sure about the first comment issue.

But for the second comment, it looks like the credentials to your ldap server are wrong. I would advice you check if these are correct using something like ldapsearch (https://serverfault.com/questions/514870/how-do-i-authenticate-with-ldap-via-the-command-line), to make sure these credentials are okay.

If you are not able to bind using ldapsearch and the same credentials, it might be an issue with ldapcherry and we will look into it deeper then. But for now, please check if the credentials are okay.

kakwa avatar Nov 16 '19 18:11 kakwa

The first comment issue is caused if you installed LdapCherry using python2. Use python3 when installing and it resolves the issue.

petersont4 avatar Nov 18 '19 02:11 petersont4

Using python3 solved it for me. But I would suggest an update to the docs then.

woodcockjosh avatar Sep 02 '21 03:09 woodcockjosh