<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>UID search is non-strict</title> 
  <pubDate>Fri, 10 Apr 2026 09:35:33 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/11083</link> 
  <atom:link rel="self" type="application/rss+xml" title="UID search is non-strict" href="https://bugs.horde.org/ticket/11083/rss" /> 
  <description>UID search is non-strict</description> 
 
   
   
  <item> 
   <title>Hi,

I&#039;ve been struggling for a few weeks now, trying to m</title> 
   <description>Hi,

I&#039;ve been struggling for a few weeks now, trying to make contacts synchronization work via activesync on my Android phone (xPeria X10), without success. It seems to be able to synchronize 6 (random) contacts but no more.

To be more precise, I&#039;m using an LDAP as container for a personal adressbook. I&#039;ve setup turba to map :
         &#039;__key&#039; =&gt; &#039;dn&#039;,
        &#039;__uid&#039; =&gt; &#039;cn&#039;,
Entries look like this in my LDAP :
dn: cn=blah blah,ou=addressbook,cn=kyoshiro,ou=users,dc=kyoshiro,dc
 =org
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
givenName: blah
sn: blah
cn: blah blah
mail: ...

I had an issue in the dedicated log file for my device saying :
2012-03-17T13:29:38+01:00 ERR: Internal Horde Error: multiple turba objects with same objectId.
2012-03-17T13:29:38+01:00 DEBUG: [androidc1376193414] Saving state: Array
(
    [0] =&gt; {4f625e28-fca4-44da-9d51-40e958be147c}788
    [1] =&gt; a:494:{i:0;a:3:{s:2:&quot;id&quot;;s:12:&quot;Some Friend&quot;;s:4:&quot;type&quot;;s:6:&quot;change&quot;;s:5:&quot;flags&quot;;s:10:&quot;NewMessage&quot;;}i:1;...

    [2] =&gt; androidc1376193414
    [3] =&gt; 1331987377
    [4] =&gt; Contacts
    [5] =&gt; kyoshiro
)

I upgraded to the latest PEAR version and the serialize and ERR line seem not to appear in the logfiles anymore, but there&#039;s still only 6 contacts on my phone.

I&#039;ve attached the current log of what happens when I ask my device to resync contacts. Please let me know if you need more data on this issue.

Thanks !
Regards</description> 
   <pubDate>Sat, 17 Mar 2012 15:14:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70737</link> 
  </item> 
   
  <item> 
   <title>The UID value MUST be a globally unique identifier. The erro</title> 
   <description>The UID value MUST be a globally unique identifier. The error is telling you that more than one entry in your datastore has the same UID value.</description> 
   <pubDate>Sat, 17 Mar 2012 16:02:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70738</link> 
  </item> 
   
  <item> 
   <title>&gt; The UID value MUST be a globally unique identifier. The er</title> 
   <description>&gt; The UID value MUST be a globally unique identifier. The error is 
&gt; telling you that more than one entry in your datastore has the same 
&gt; UID value.

Yes, but it is a unique identifier : 
~$ grep &#039;cn:&#039; slapcat.ldif  &gt; cn.list
~$ grep &#039;cn:&#039; slapcat.ldif |sort -u  &gt; cn2.list
~$ wc -l cn*
  524 cn2.list
  524 cn.list

Plus, at the moment I don&#039;t have this error in my log anymore, so I don&#039;t understand why it&#039;s not syncing :/

LDAP is great for handling accounts and providing detailed information about each user. And in this case using &quot;uid&quot; as a globally unique identifier is easy. But in my case, I&#039;m using LDAP as a storage for a personal LDAP, so these entries don&#039;t have any uid since they&#039;re not real users. I decided to use &quot;cn&quot; as identifier, and even if someday something could lead to a non unique issue, it&#039;s not the case at the moment.

I&#039;m a bit lost, I don&#039;t really understand why - even now this issue is gone - sync is only working for a few contacts. You can see the log I attached in my previous post for more information.

Thanks</description> 
   <pubDate>Sat, 17 Mar 2012 16:30:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70739</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; The UID value MUST be a globally unique identifier. The e</title> 
   <description>&gt;&gt; The UID value MUST be a globally unique identifier. The error is
&gt;&gt; telling you that more than one entry in your datastore has the same
&gt;&gt; UID value.
&gt;
&gt; Yes, but it is a unique identifier :
&gt; ~$ grep &#039;cn:&#039; slapcat.ldif  &gt; cn.list
&gt; ~$ grep &#039;cn:&#039; slapcat.ldif |sort -u  &gt; cn2.list
&gt; ~$ wc -l cn*
&gt;   524 cn2.list
&gt;   524 cn.list

Then you have to find out why Turba&#039;s search functions return more than one result for for the UID field see Turba_Api#export() in turba/lib/Api.php.

&gt; Plus, at the moment I don&#039;t have this error in my log anymore, so I 
&gt; don&#039;t understand why it&#039;s not syncing :/

Because you already have done the initial SYNC. After the first SYNC, only changes reported by the history system are taken into account.  You can clear the ActiveSync binding to your device from either the user ActiveSync prefs, or the device list in the administrative section. This will re-do the initial sync. 
</description> 
   <pubDate>Sat, 17 Mar 2012 16:58:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70741</link> 
  </item> 
   
  <item> 
   <title>
&gt; Then you have to find out why Turba&#039;s search functions r</title> 
   <description>
&gt; Then you have to find out why Turba&#039;s search functions return more 
&gt; than one result for for the UID field see Turba_Api#export() in 
&gt; turba/lib/Api.php.

Ok I&#039;ll try to use these functions and I&#039;ll come back to you afterwards

&gt; Because you already have done the initial SYNC. After the first SYNC, 
&gt; only changes reported by the history system are taken into account.  
&gt; You can clear the ActiveSync binding to your device from either the 
&gt; user ActiveSync prefs, or the device list in the administrative 
&gt; section. This will re-do the initial sync.
&gt;

I tried reprovisionning devices and removing the device from the administrative section, but no luck. I suppose there still are issues with the results returned by my LDAP... or in the configuration.</description> 
   <pubDate>Mon, 19 Mar 2012 08:59:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70747</link> 
  </item> 
   
  <item> 
   <title>&gt;
&gt;&gt; Then you have to find out why Turba&#039;s search functions</title> 
   <description>&gt;
&gt;&gt; Then you have to find out why Turba&#039;s search functions return more
&gt;&gt; than one result for for the UID field see Turba_Api#export() in
&gt;&gt; turba/lib/Api.php.
&gt;
&gt; Ok I&#039;ll try to use these functions and I&#039;ll come back to you afterwards
&gt;
&gt;&gt; Because you already have done the initial SYNC. After the first SYNC,
&gt;&gt; only changes reported by the history system are taken into account.
&gt;&gt; You can clear the ActiveSync binding to your device from either the
&gt;&gt; user ActiveSync prefs, or the device list in the administrative
&gt;&gt; section. This will re-do the initial sync.
&gt;&gt;
&gt;
&gt; I tried reprovisionning devices and removing the device from the 
&gt; administrative section, but no luck. I suppose there still are issues 
&gt; with the results returned by my LDAP... or in the configuration.

I&#039;ve got my answer, I think. I&#039;m using cn as identifier (__uid)

When I look for Joris, the Turba_Api::export(&#039;Joris&#039;, &#039;text/x-vcard&#039;) returns these 2 similar entries :
cn: Joris
cn: zzz Old Joris

I think the uid search is not an exact seach but a &quot;contains&quot; search, which I suppose is not valid behavior.
But then again, I&#039;m not an expert so maybe I&#039;m wrong ?
Is there a quick way to fix this (other than searching for contacts having their &quot;cn&quot; contained in another contact&#039;s &quot;cn&quot; and changing their __uid) ?

Thanks for your support.</description> 
   <pubDate>Mon, 19 Mar 2012 15:32:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70755</link> 
  </item> 
   
  <item> 
   <title>Ah, ok. That makes sense then.  The UID should be a strict s</title> 
   <description>Ah, ok. That makes sense then.  The UID should be a strict search.

Probably haven&#039;t run into this issue since it would only be an issue if the search term contains spaces (if the search is &quot;strict&quot; then the string is split on spaces and an OR search is performed on the parts).  Typically UIDs would not have spaces which is why we haven&#039;t run into this earlier I guess.

The quick fix - and the correct fix too - is to add the field to the &quot;strict&quot; array in your backends.local.php file where your ldap source is defined. </description> 
   <pubDate>Mon, 19 Mar 2012 15:44:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70756</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (develop):

commit 8f9a27c43f0</title> 
   <description>Changes have been made in Git (develop):

commit 8f9a27c43f01d717155249f7fe24b4e4aacff510
Author: Michael J Rubinsky &lt;mrubinsk@horde.org&gt;
Date:   Mon Mar 19 11:47:25 2012 -0400

    Bug: 11083 UID should always be a strict search.

 turba/config/backends.php |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/8f9a27c43f01d717155249f7fe24b4e4aacff510</description> 
   <pubDate>Mon, 19 Mar 2012 15:49:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70757</link> 
  </item> 
   
  <item> 
   <title>Updated example/default configurations to reflect this.</title> 
   <description>Updated example/default configurations to reflect this.</description> 
   <pubDate>Mon, 19 Mar 2012 15:50:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70759</link> 
  </item> 
   
  <item> 
   <title>&gt; Ah, ok. That makes sense then.  The UID should be a strict</title> 
   <description>&gt; Ah, ok. That makes sense then.  The UID should be a strict search.
&gt;
&gt; Probably haven&#039;t run into this issue since it would only be an issue 
&gt; if the search term contains spaces (if the search is &quot;strict&quot; then 
&gt; the string is split on spaces and an OR search is performed on the 
&gt; parts).  Typically UIDs would not have spaces which is why we haven&#039;t 
&gt; run into this earlier I guess.
&gt;
&gt; The quick fix - and the correct fix too - is to add the field to the 
&gt; &quot;strict&quot; array in your backends.local.php file where your ldap source 
&gt; is defined.

Oh yes of course ! It&#039;s my fault too, I didn&#039;t really understood what was the meaning of the approximate and strict arrays / parameters in the configuration.

It&#039;s currently synchronizing, thanks a lot for your help :)</description> 
   <pubDate>Mon, 19 Mar 2012 16:05:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70760</link> 
  </item> 
   
  <item> 
   <title>Hmm I don&#039;t know if it&#039;s related but some contacts are still</title> 
   <description>Hmm I don&#039;t know if it&#039;s related but some contacts are still missing. I can&#039;t find them in the serialized array logged in the dedicated logfile in DEBUG mode. I suspect they&#039;re not in the contacts list sent to my phone, and thus not synced.

I tried using the API to export() the corresponding uid, and it works. I also get the contacts whenever I do a Api::search(&#039;part of the name/uid&#039;). How can I use the API to get the same contact list as the one sent by the rpc.php / Activesync module ?

Regards</description> 
   <pubDate>Mon, 19 Mar 2012 17:15:48 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70761</link> 
  </item> 
   
  <item> 
   <title>The serialized array in the horde_activesync_state table onl</title> 
   <description>The serialized array in the horde_activesync_state table only holds the entries for items that have NOT yet been sync&#039;d - not all entries are sent in a single request - we hold the pending items in that array, and they are removed once sent to the device. Once the initial sync is done, only items that have changed are sent to the device.

This initial list is obtained by calling $registry-&gt;contacts-&gt;listUids() - which returns the UIDs of all the contacts we want to send. We then call $registry-&gt;contacts-&gt;export() to fetch each entry.</description> 
   <pubDate>Mon, 19 Mar 2012 17:29:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70762</link> 
  </item> 
   
  <item> 
   <title>&gt; The serialized array in the horde_activesync_state table o</title> 
   <description>&gt; The serialized array in the horde_activesync_state table only holds 
&gt; the entries for items that have NOT yet been sync&#039;d - not all entries 
&gt; are sent in a single request - we hold the pending items in that 
&gt; array, and they are removed once sent to the device. Once the initial 
&gt; sync is done, only items that have changed are sent to the device.
&gt;
&gt; This initial list is obtained by calling 
&gt; $registry-&gt;contacts-&gt;listUids() - which returns the UIDs of all the 
&gt; contacts we want to send. We then call $registry-&gt;contacts-&gt;export() 
&gt; to fetch each entry.

Thanks.

I checked the uid list and some were really missing. In fact, I tried a ldapsearch and saw a &quot;size limit exceeded&quot;. My server was by default configured to limit any query to 500 results max.

I raised the value to 1000 but maybe there should be a notification somewhere (logs, user/admin feedback ?) so that people may fix the issue ? I might not be the only one having more than 500 contacts and a configured limit since it&#039;s debian&#039;s default ? ^^&#039;

Anyways, now I&#039;ve got my full contact list on my phone, thanks a lot for your help !</description> 
   <pubDate>Tue, 20 Mar 2012 10:06:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t70784</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (master):

commit 8f9a27c43f01</title> 
   <description>Changes have been made in Git (master):

commit 8f9a27c43f01d717155249f7fe24b4e4aacff510
Author: Michael J Rubinsky &lt;mrubinsk@horde.org&gt;
Date:   Mon Mar 19 11:47:25 2012 -0400

    Bug: 11083 UID should always be a strict search.

 turba/config/backends.php |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/8f9a27c43f01d717155249f7fe24b4e4aacff510</description> 
   <pubDate>Wed, 29 Aug 2012 12:33:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11083#t72500</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
