Traceback with "No such object" although there is indeed such an object (works with "ldapsearch")
Hi all,
Doing an ldapsearch in the shell works, but the same search in python
does not. I tried for a couple of hours already to no avail, so I write
here hoping that one of you might be able to give me help:
Working example (in bash shell):
$ ldapsearch -x -LLL "(ou=People)" -b "dc=mydomain,dc=com"
dn: ou=People,dc=mydomain,dc=com
ou: People
objectClass: organizationalUnit
description: Users of my domain
Not working (in python shell):
==
>>> import ldap
>>> l = ldap.initialize("ldap://127.0.0.1";)
>>> l.simple_bind_s("","")
>>> l.search_s('o=mydomain, c=com', ldap.SCOPE_SUBTREE, '(ou=People)')
# I also tried it with ...'ou=People'without the parentheses
In both cases I get this traceback:
File "", line 1, in ?
File "/usr/lib64/python2.3/site-packages/ldap/ldapobject.py", line
461, in search_s return
self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,timeout=self.timeout)
File "/usr/lib64/python2.3/site-packages/ldap/ldapobject.py", line 455,
in search_ext_s return self.result(msgid,all=1,timeout=timeout)[1] File
"/usr/lib64/python2.3/site-packages/ldap/ldapobject.py", line 392, in
result res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
File "/usr/lib64/python2.3/site-packages/ldap/ldapobject.py", line 398,
in result2 return self._ldap_call(self._l.result2,msgid,all,timeout)
File "/usr/lib64/python2.3/site-packages/ldap/ldapobject.py", line 94,
in _ldap_call result = func(*args,**kwargs) ldap.NO_SUCH_OBJECT:
{'info': '', 'desc': 'No such object'}
Does someone have an idea how I can get any results?
Martin
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
Re: Traceback with "No such object" although there is indeed such an object (works with "ldapsearch")
Martin Winkler wrote:
$ ldapsearch -x -LLL "(ou=People)" -b "dc=mydomain,dc=com"
l = ldap.initialize("ldap://127.0.0.1";)
l.simple_bind_s("","")
l.search_s('o=mydomain, c=com', ldap.SCOPE_SUBTREE, '(ou=People)')
because "o=mydomain,c=com" != "dc=mydomain,dc=com" ?
--
David Leonard [EMAIL PROTECTED]
Ph:+61 404 844 850
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
Re: Traceback with "No such object" although there is indeed such an object (works with "ldapsearch")
Sorry, forgot to mention some facts: python-ldap version: >>> ldap.VERSION 2 Python Version: Python 2.3.4 [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] $ ldapsearch -VV ldapsearch: @(#) $OpenLDAP: ldapsearch 2.2.13 (May 3 2007 01:38:21) $ [EMAIL PROTECTED]:/builddir/build/BUILD/openldap-2.2.13/openldap-2.2.13/build-clients/clients/tools (LDAP library: OpenLDAP 20213) Maybe these things are important. Martin - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Python-LDAP-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
Re: Traceback with "No such object" although there is indeed such an object (works with "ldapsearch")
Please ignore my previous postings. My error was so trivial... I had different ldap-bases in my 2 examples. everything works fine now. sorry to have bothered you all. Martin - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Python-LDAP-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
Re: Local Error in simple_bind_s();
Michael Ströder <[EMAIL PROTECTED]> wrote on 18/12/2007 05:05:16 PM: > Leons Petrazickis wrote: > > > > I've installed Thorsten Kurbad's python_ldap-2.3.1-py2.4-linux-i686.egg on > > my Python 2.4 install > > Which OS? Which Linux distribution? Which OpenLDAP libs? I was using: Ubuntu 7.10 with Linux kernel 2.6.22-14-386 OpenLDAP 2.3.35-1ubuntu0.1 libsasl2 2.1.22.dfsg1-9ubuntu2 Python 2.4.4-6ubuntu4 Just now, I installed: OpenLDAP 2.3.39 This command worked fine: ldapsearch -h bluepages.ibm.com -P 2 -x -b "ou=bluepages,o=ibm.com" -s sub "(sn=Leon)" cn tieline But the python-ldap error stayed the same. I then compiled a custom copy of python-ldap 2.3.1. I got these warnings during compilation: file Lib/ldap.py (for module ldap) not found file Lib/ldap/schema.py (for module ldap.schema) not found (The files are not in the download.) It compiled and installed without fatal errors. However, it now crashes very differently: Traceback (most recent call last): File "test.py", line 10, in ? ldap.set_option(ldap.OPT_DEBUG_LEVEL,4095) File "/usr/lib/python2.4/site-packages/python_ldap-2.3.1-py2.4-linux-i686.egg/ldap/functions.py", line 126, in set_option _ldap_function_call(_ldap.set_option,option,invalue) AttributeError: 'module' object has no attribute 'set_option' Should I go back to the prebuilt .egg? > Hmm, yes something's really strange. > > If on Linux could you please check with ldd > /_ldap.so which OpenLDAP libs are actually used. With Ubuntu's OpenLDAP: linux-gate.so.1 => (0xe000) libldap_r-2.3.so.0 => /usr/lib/libldap_r-2.3.so.0 (0xb7f2a000) liblber-2.3.so.0 => /usr/lib/liblber-2.3.so.0 (0xb7f1d000) libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7f05000) libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb7ec4000) libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7d81000) libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7d69000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7c1f000) libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7c0b000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7c07000) libz.so.1 => /usr/lib/libz.so.1 (0xb7bf2000) /lib/ld-linux.so.2 (0x8000) With custom OpenLDAP: linux-gate.so.1 => (0xe000) libldap_r-2.3.so.0 => /usr/lib/libldap_r-2.3.so.0 (0xb7ebd000) liblber-2.3.so.0 => /usr/lib/liblber-2.3.so.0 (0xb7eb) libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7e98000) libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb7e57000) libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7d14000) libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7cfc000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7bb2000) libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7b9e000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7b9a000) libz.so.1 => /usr/lib/libz.so.1 (0xb7b85000) /lib/ld-linux.so.2 (0x8000) Regards, Leons Petrazickis http://lpetr.org/blog - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Python-LDAP-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
