[sync] [horde] Sync with Funambol
Paul Faure
paul.faure at agr.gc.ca
Wed Nov 5 20:20:03 UTC 2008
> > The error is that any new contact I add on the client does not show up
> > on the server. The error I constantly get is "already exists with server
> > id 3e37b9140457c0f37039de9227cb4915"
> > If I add 5 new contacts on the client, they all give me that error when
> > I sync it.
>
> All with the same id?
Yes, all with the same ID. And that ID can't be found anywhere on the
client, or in the /tmp/sync/client_*.xml logs.
> > I have tried removing all contacts on the client and removing the sync
> > data on the server then starting from scratch.
> > Server -> Client works fine.
> > Client -> Server (update only) works.
> > Client -> Server (new contact) always gives me the error above.
> >
> > The contacts I tested with have had minimal information in them
> > (sometimes just a name and a note) or just a name and an email. The
> > example below is one of just a name and a note. Yea, not useful but its
> > for testing.
> >
> > I have no idea where the contact ID of
> > "3e37b9140457c0f37039de9227cb4915" comes from. It is not sent by the
> > client, the logs /tmp/sync/client* dont have any mention of it, and I
> > scanned the entire database and could not find it in there either
> > (except after the failed sync and it shows up in the sync map table).
> >
> > I was under the impression that a proper contact ID had the form of
> > "20080707114252.193522rqn30xy740 at DOMAIN.COM".
>
> Yes, exactly. What's the client id of the entry in the map table after
> the failed sync? Does it match one of the ids sent from the client?
An example of a failed sync map entry (when I created a new contact on
the client and tried to sync it to the server):
syncml_syncpartner = fol-T05PVFRBNDc2NTA2OmZhdXJlcA==
syncml_db = contacts
syncml_uid = paul
syncml_cuid =
0000000080686E075BD4C7488AD4D1CFE7CA75700700AC094F4F121FB74DAB99B50F115983F900000132119F00005F1403857813194AACFA1F3F566A159400000188CBFD0000
syncml_suid = 3e37b9140457c0f37039de9227cb4915
syncml_timestamp = 0
Also, I can't find a matching entry in turba_objects where object_uid =
3e37b9140457c0f37039de9227cb4915.
How is the contact ID generated? And with a new contact, who (client or
server) is responsible to generate it.
Im more than willing to debug this one myself, I just need a little bit
of background info.
In order to setup an LDAP front end to the Horde contact table, I had to
create a new field in the turba_objects table called "id" which is
simply a unique auto_inc 32 bit integer. OpenLDAP with a DB backend
requires this integer field as a unique entry instead of a varchar
unique field.
This could be the cause of my troubles.
> > Thanks for forwarding to the sync list... Didnt know one existed.
> >
> > PS. Sorry if you guys are getting this email a few times, our department
> > just changed our email addresses, so I keept getting a bounce back
> > saying im not on the sync mailing list.
> >
> > On Thu, 2008-10-30 at 18:20 +0100, Jan Schneider wrote:
> >
> >> There is a synchronization mailing list, please use that for follow-ups.
> >>
> >> Zitat von Paul Faure <faurep at agr.gc.ca>:
> >>
> >> > Hi All,
> >> >
> >> > Sync between Outlook and Horde used to work perfectly back with horde
> >> > 1.1.
> >> > I have recently upgraded to horde 1.2 and now when I create a new
> >> > contact on a client and sync, it gives me the error below:
> >>
> >> Which error? I can't see any error message.
> >>
> >> > ==> log.txt <==
> >> > DEBUG: Backend of class syncml_backend_horde created
> >> > DEBUG: Started at 2008-10-28 14:00:16. Packet logged
> >> > in /tmp/sync/client_25701.xml
> >> > DEBUG: Existing session continued: 3853582193943de92a9c4b7f683a0b8f
> >> > DEBUG: Authenticated: yes; version: 1.1; message ID: 2; source URI:
> >> > iph-PpMbXDksxKOlkU0oFXOIjQ==; target URI:
> >> > https://HOSTNAME:443/horde/rpc.php; user: USER; charset: UTF-8; wbxml:
> >> > no
> >> > DEBUG: Using default device class
> >> > DEBUG: Handling <Add> sent from client
> >> > DEBUG: Using default device class
> >> > NOTICE: Adding client entry to server: already exists with server id
> >> > 3e37b9140457c0f37039de9227cb4915
> >> > DEBUG: SQL Query by SyncML_Backend_Horde::_getSuid(): SELECT
> >> > syncml_suid FROM horde_syncml_map WHERE syncml_syncpartner = ? AND
> >> > syncml_db = ? AND syncml_uid = ? AND syncml_cuid = ?, values:
> >> > iph-PpMbXDksxKOlkU0oFXOIjQ==, contacts, USER, 571
> >> > DEBUG: SQL Query by SyncML_Backend_Horde::createUidMap(): INSERT INTO
> >> > horde_syncml_map (syncml_suid, syncml_timestamp, syncml_syncpartner,
> >> > syncml_db, syncml_uid, syncml_cuid) VALUES (?, ?, ?, ?, ?, ?), values:
> >> > 3e37b9140457c0f37039de9227cb4915, 0, iph-PpMbXDksxKOlkU0oFXOIjQ==,
> >> > contacts, USER, 571
> >> > DEBUG: Added client entry as 3e37b9140457c0f37039de9227cb4915
> >> > DEBUG: Received <Final> from client.
> >> > DEBUG: Handle <Final> for state Sync
> >> > DEBUG: Creating <Sync> output for server changes in database card
> >> > DEBUG: Using default device class
> >> > DEBUG: Compiling server changes from 2008-10-26 23:09:06 to 2008-10-28
> >> > 14:00:13
> >> > DEBUG: SQL Query by SyncML_Backend_Horde::_getChangeTS(): SELECT
> >> > syncml_timestamp FROM horde_syncml_map WHERE syncml_syncpartner = ? AND
> >> > syncml_db = ? AND syncml_uid = ? AND syncml_suid = ?, values:
> >> > iph-PpMbXDksxKOlkU0oFXOIjQ==, contacts, USER,
> >> > 20080707114252.193522rqn30xy740 at DOMAIN
> >> > DEBUG: SQL Query by SyncML_Backend_Horde::_getCuid(): SELECT
> >> > syncml_cuid FROM horde_syncml_map WHERE syncml_syncpartner = ? AND
> >> > syncml_db = ? AND syncml_uid = ? AND syncml_suid = ?, values:
> >> > iph-PpMbXDksxKOlkU0oFXOIjQ==, contacts, USER,
> >> > 20080707114252.193522rqn30xy740 at DOMAIN
> >> > DEBUG: Modifying on client from db contacts, client id 488 -> server id
> >> > 20080707114252.193522rqn30xy740 at DOMAIN
> >> > DEBUG: Sending 1 server changes for client URI card
> >> > DEBUG: Sending replace from server:
> >> > 20080707114252.193522rqn30xy740 at DOMAIN
> >> > DEBUG: Using default device class
> >> > DEBUG: Sending <Final> to client
> >> > DEBUG: Return message completed
> >> > DEBUG: Finished at 2008-10-28 14:00:16. Packet logged
> >> > in /tmp/sync/server_25701.xml
> >> >
> >> > This happens with both the iPhone and Outlook with the funambol client
> >> > (version 6.6 and 7.0).
> >> > Updating an entry on the client works well.
> >> >
> >> > I tracked it down to failing in this section of code:
> >> > horde-webmail-1.2/lib/SyncML/Backend/Horde.php:373
> >> >
> >> > $suid = $registry->call(
> >> > $database . '/import',
> >> > array($content,
> >> > $contentType,
> >> > SyncML_Backend::getParameter($databaseURI, 'source')));
> >> >
> >> > if (!is_a($suid, 'PEAR_Error')) {
> >> > ...
> >> > } else {
> >> > // Failed import. Maybe the entry is already there. Check if a
> >> > // guid is returned:
> >> > if ($suid->getDebugInfo()) {
> >> > $suid = $suid->getDebugInfo();
> >> > $this->logMessage(
> >> > 'Adding client entry to server: already exists
> >> > with server id ' . $suid,
> >> > __FILE__, __LINE__, PEAR_LOG_NOTICE);
> >> > ...
> >>
> >> So? The card that you are trying to add seems to have an id that has
> >> been used earlier for a contact that already exists on the server.
> >>
> >> > /tmp/sync/client_25701.xml:
> >> > <?xml version="1.0" encoding="UTF-8"?>
> >> > <SyncML>
> >> > <SyncHdr><VerDTD>1.1</VerDTD>
> >> > <VerProto>SyncML/1.1</VerProto>
> >> > <SessionID>1225216800</SessionID>
> >> > <MsgID>2</MsgID>
> >> > <Target><LocURI>https://HOSTNAME:443/horde/rpc.php</LocURI>
> >> > </Target>
> >> > <Source><LocURI>iph-PpMbXDksxKOlkU0oFXOIjQ==</LocURI>
> >> > </Source>
> >> > </SyncHdr>
> >> > <SyncBody><Status><CmdID>1</CmdID>
> >> > <MsgRef>1</MsgRef>
> >> > <CmdRef>0</CmdRef>
> >> > <Cmd>SyncHdr</Cmd>
> >> > <TargetRef>https://HOSTNAME:443/horde/rpc.php</TargetRef>
> >> > <SourceRef>iph-PpMbXDksxKOlkU0oFXOIjQ==</SourceRef>
> >> > <Data>200</Data>
> >> > </Status>
> >> > <Status><CmdID>2</CmdID>
> >> > <MsgRef>1</MsgRef>
> >> > <CmdRef>3</CmdRef>
> >> > <Cmd>Alert</Cmd>
> >> > <TargetRef>card</TargetRef>
> >> > <SourceRef>addressbook</SourceRef>
> >> > <Data>200</Data>
> >> > <Item><Data><Anchor xmlns="syncml:metinf"><Next>1225216813</Next>
> >> > </Anchor>
> >> > </Data>
> >> > </Item>
> >> > </Status>
> >> > <Status><CmdID>4</CmdID>
> >> > <MsgRef>1</MsgRef>
> >> > <CmdRef>4</CmdRef>
> >> > <Cmd>Get</Cmd>
> >> > <Data>200</Data>
> >> > </Status>
> >> > <Results><CmdID>3</CmdID>
> >> > <MsgRef>1</MsgRef>
> >> > <CmdRef>4</CmdRef>
> >> > <Meta><Type xmlns="syncml:metinf">application/vnd.syncml-devinf+xml</Type>
> >> > </Meta>
> >> > <Item><Source><LocURI>./devinf11</LocURI>
> >> > </Source>
> >> > <Data><DevInf xmlns="syncml:devinf"><VerDTD>1.1</VerDTD>
> >> > <Man>Funambol Inc.</Man>
> >> > <Mod>iPhone</Mod>
> >> > <OEM>Open Source</OEM>
> >> > <SwV>7.0.3</SwV>
> >> > <DevID>iph-PpMbXDksxKOlkU0oFXOIjQ==</DevID>
> >> > <DevTyp>iPhone</DevTyp>
> >> >
> >> <UTC/><SupportNumberOfChanges/><DataStore><SourceRef>addressbook</SourceRef>
> >> > <Rx-Pref><CTType>text/x-vcard</CTType>
> >> > <VerCT>2.1</VerCT>
> >> > </Rx-Pref>
> >> > <Rx><CTType>text/x-vcard</CTType>
> >> > <VerCT></VerCT>
> >> > </Rx>
> >> > <Tx-Pref><CTType>text/x-vcard</CTType>
> >> > <VerCT>2.1</VerCT>
> >> > </Tx-Pref>
> >> > <Tx><CTType>text/x-vcard</CTType>
> >> > <VerCT></VerCT>
> >> > </Tx>
> >> > <SyncCap><SyncType>2</SyncType>
> >> > <SyncType>1</SyncType>
> >> > <SyncType>5</SyncType>
> >> > <SyncType>3</SyncType>
> >> > </SyncCap>
> >> > </DataStore>
> >> > </DevInf>
> >> > </Data>
> >> > </Item>
> >> > </Results>
> >> > <Sync><CmdID>5</CmdID>
> >> > <Target><LocURI>card</LocURI>
> >> > </Target>
> >> > <Source><LocURI>addressbook</LocURI>
> >> > </Source>
> >> > <Add><CmdID>6</CmdID>
> >> > <Meta><Type xmlns="syncml:metinf">text/x-vcard</Type>
> >> > </Meta>
> >> > <Item><Source><LocURI>571</LocURI>
> >> > </Source>
> >> > <Data><![CDATA[BEGIN:VCARD^M
> >> > VERSION:2.1^M
> >> > N:;Test a;;;^M
> >> > BDAY:^M
> >> > NOTE:^M
> >> > TEL;VOICE;WORK:^M
> >> > TEL;WORK;FAX:^M
> >> > TEL;WORK;PREF:^M
> >> > TEL;VOICE;HOME:^M
> >> > TEL;HOME;FAX:^M
> >> > TEL;FAX:^M
> >> > TEL;CAR:^M
> >> > TEL;CELL:^M
> >> > TEL;VOICE:^M
> >> > TEL;PAGER:^M
> >> > TEL;PREF;VOICE:^M
> >> > URL;WORK:^M
> >> > URL;HOME:^M
> >> > URL:^M
> >> > EMAIL;INTERNET:^M
> >> > EMAIL;INTERNET;HOME:^M
> >> > EMAIL;INTERNET;WORK:^M
> >> > TITLE:^M
> >> > NICKNAME:^M
> >> > ORG:;;^M
> >> > ADR;HOME:;;;;;;^M
> >> > ADR:;;;;;;^M
> >> > ADR;WORK:;;;;;;^M
> >> > PHOTO:^M
> >> > END:VCARD^M
> >> > ]]></Data>
> >> > </Item>
> >> > </Add>
> >> > </Sync>
> >> > <Final/></SyncBody>
> >> > </SyncML>
> >>
> >> Either not a very useful contact anyway, or your client is broken, or
> >> you removed all field values from the logs.
> >>
> >> Jan.
> >>
> > --
> > sync mailing list - Join the hunt: http://horde.org/bounties/#sync
> > Frequently Asked Questions: http://horde.org/faq/
> > To unsubscribe, mail: sync-unsubscribe at lists.horde.org
> >
>
>
>
> Jan.
>
More information about the sync
mailing list