Hi All,<div><br></div><div>I am doing a search using Python LDAP and the search function is throwing an exception <b>ldap.NO_SUCH_OBJECT</b></div><div><br></div><div>Session transcript is as follows</div><div><br></div><div>
<div><font face="courier new, monospace">>>> import ldap</font></div><div><font face="courier new, monospace">>>> l=ldap.initialize('ldap://localhost:389')</font></div><div><font face="courier new, monospace">>>> who="CN=guddu,OU=Appl Groups,OU=Central,OU=CL,DC=c.corp,O=App,C=US"</font></div>
<div><font face="courier new, monospace">>>> cred="12345"</font></div><div><font face="courier new, monospace">>>> result=l.bind(who,cred)</font></div><div><font face="courier new, monospace">>>> l.result(result)</font></div>
<div><font face="courier new, monospace">(97, [])</font></div><div><font face="courier new, monospace">>>> l.search_s('OU=Appl Groups,OU=Central,OU=CL,DC=c.corp,O=App,C=US',ldap.SCOPE_SUBTREE,'(cn=gud*)',['cn'])</font></div>
<div><font face="courier new, monospace">Traceback (most recent call last):</font></div><div><font face="courier new, monospace"> File "<stdin>", line 1, in <module></font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 552, in search_s</font></div>
<div><font face="courier new, monospace"> return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)</font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 546, in search_ext_s</font></div>
<div><font face="courier new, monospace"> return self.result(msgid,all=1,timeout=timeout)[1]</font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 458, in result</font></div>
<div><font face="courier new, monospace"> resp_type, resp_data, resp_msgid = self.result2(msgid,all,timeout)</font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 462, in result2</font></div>
<div><font face="courier new, monospace"> resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all,timeout)</font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 469, in result3</font></div>
<div><font face="courier new, monospace"> resp_ctrl_classes=resp_ctrl_classes</font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 476, in result4</font></div>
<div><font face="courier new, monospace"> ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)</font></div><div><font face="courier new, monospace"> File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 99, in _ldap_call</font></div>
<div><font face="courier new, monospace"> result = func(*args,**kwargs)</font></div><div><font face="courier new, monospace">ldap.NO_SUCH_OBJECT: {'info': "0000208D: NameErr: DSID-031521D2, problem 2001 (NO_OBJECT), data 0, best match of:\n\t'O=App,C=US'\n", 'matched': 'O=App,C=US', '</font></div>
<div><font face="courier new, monospace">desc': 'No such object'}</font></div></div><div><br></div><div>What's intriguing is that the same search works fine using the ldp.exe explorer. Here is the session transcript and I have also attached a image at <a href="http://imgur.com/nj6Tlsi">http://imgur.com/nj6Tlsi</a> with more details.</div>
<div><br></div><div><div><font face="courier new, monospace">***Searching...</font></div><div><font face="courier new, monospace">ldap_search_s(ld, "OU=Appl Groups,OU=Central,OU=CL,DC=c.corp,O=App,C=US", 1, "(cn=gud*)", attrList, 0, &msg)</font></div>
<div><font face="courier new, monospace">Getting 1 entries:</font></div><div><font face="courier new, monospace">>> Dn: CN=guddu,OU=Appl Groups,OU=Central,OU=CL,DC=c.corp,O=App,C=US</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span>1> cn: guddu; </font></div>
<div><font face="courier new, monospace">-----------</font></div></div><div><br></div><div>Please guide.</div><div><br></div><div>Regards,</div><div>Guddu</div>