[sync] Sync failed => Duplicated entries

Hans Henrik Gabelgaard hhg at guideix.dk
Wed May 4 13:42:53 PDT 2005


Hi Karsten

Your right, the answer is in the log: There is no Summery, the last lines is:

May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid= suid=error_message_prefix refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid=1 suid=mode refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid=1024 suid=level refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid=-1 suid=code refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid=DB Error: unknown error suid=message refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid= [nativecode=1065 ** Query was empty] suid=userinfo refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid=Array suid=backtrace refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:36 HORDE [debug] [horde] SyncML: delete: cuid= suid=callback refts: 1114985855 [on line 154 of "/usr/share/php/Horde/SyncML/Sync.php"]
May 04 20:10:37 HORDE [debug] [horde] SyncML: SyncML: return message completed [on line 489 of "/usr/share/php/Horde/SyncML.php"]

The [nativecode=1065 ** Query was empty] dosn't look god and it is transmitted to the phone - Here is the last few lines from the last packet from the server:

<Delete><CmdID>21</CmdID><Item></Item></Delete><Delete><CmdI
D>22</CmdID><Item><Target><LocURI>1</LocURI></Target></Item></Delete><Delete><Cm
dID>23</CmdID><Item><Target><LocURI>1024</LocURI></Target></Item></Delete><Delet
e><CmdID>24</CmdID><Item><Target><LocURI>-1</LocURI></Target></Item></Delete><De
lete><CmdID>25</CmdID><Item><Target><LocURI>DB Error: unknown error</LocURI></Ta
rget></Item></Delete><Delete><CmdID>26</CmdID><Item><Target><LocURI> [nativecode
=1065 ** Query was empty]</LocURI></Target></Item></Delete><Delete><CmdID>27</Cm
dID><Item><Target><LocURI>Array</LocURI></Target></Item></Delete><Delete><CmdID>
28</CmdID></Delete></Sync><Status><CmdID>Object</CmdID><MsgRef>2</MsgRef><CmdRef
>4</CmdRef><Cmd>Sync</Cmd><SourceRef>c:\Documents\agenda\agenda</SourceRef><Targ
etRef>calendar</TargetRef><Data>200</Data></Status><Final></Final></SyncBody></S
yncML>

So no wonder the phone is complaining...

I assume this is the MySql error:
Error: 1065 SQLSTATE: 42000 (ER_EMPTY_QUERY) 

Message: Query was empty 

Is it the cuid = -1 there is causing the problems?
I can't find -1 in the datatree browser under /syncml/hhg/<imei-number>/calendar/cuid2suid

Let me know if you need additionel logs or other info

Best regards
Hans Henrik 




-----Original Message-----
From: sync-bounces at lists.horde.org
[mailto:sync-bounces at lists.horde.org]On Behalf Of Karsten Fourmont
Sent: 4. maj 2005 08:11
To: sync at lists.horde.org
Subject: Re: [sync] Sync failed => Duplicated entries


Hans Henrik Gabelgaard wrote:

> Hi Karsten
> 
> Thanks! All-day events seems to be working, but now i've got a new problem: New appointments created today are been duplicated, probaly because something goes wrong in the sync proces and the P900 reports sync failure, but everything is synced, and at the next sync, todays entry are duplicated (and the P900 reports sync failure)

> In horde.log i've seen a lot of these messages:
> SyncML: add: 20050503222014.6owney44rshs at webmin.gabelgaard.org ignored, came from client [on line 196 of "/usr/share/php/Horde/SyncML/Backend.php"] 

they are perfectly okay: this occurs when a entry in the server has been 
added/replaced due to a request from the client. When the server then 
gets its change history from horde, this entry is returned as a change 
as well of course: Horde History does not know if a change is manually 
made on the horde gui or created by SyncML due to a client request. So 
in this case it should not be sent back to the client as that's where it 
came from.


> 
> And that ID match a duplicated entry
> 

> Later in the logs a lot of:
> SyncML: Unable to create change for CD0000008B9511D182D800C04FB1625D9D25EB1DA801B94BB43540A37EB0B7B2: client-id not found in map. Trying add instead. [on line 103 of "/usr/share/php/Horde/SyncML/Backend.php"]
That's where the problem occurs: the client sends a replace request. 
Horde SyncML is unable to map the client id to a horde server id and so 
it assumes it's a new event and adds it instead.

This may happen if you modify entries that you sync prior to the april 
24th upgrade: the map format has changed somewhat so it may no longer 
find the old map entries. But it should not happen for entries you 
created today.

> 
> But that ID came from an in Kronolith imported iCal file... Which on the first sync was sent to the P900 and on the next duplicatede back to Horde/Kronolith

I tried both

1) create new entry in horde
2) sync
3) modify in client
4) sync
works fine, no dupes
and

1) create new entry in client
2) sync
3) modify in server
4) sync
works fine for me, too.


> So somehow it's out-of-sync...
> 
> Conclusion:
> On calender sync, P900 reports failure everytime

ah, so you have an incomplete sync.

what exactly does the p900 report?

That may be the reason: there's no such thing as a "rollback" for 
incomplete sync sessions. So if you have a sync that does _not_ end with 
a line "SyncML: Summary:" in the logs, it is incomplete and will be 
retried on the next run. All entries already created during the partial 
sync will be probably duplicated.

So what does the log say? PHP error logs?


> On Contacts sync, P900 reports succes, but nothing is synced, horde logs says:
>  SyncML: Error in adding client entry due to replace request:Invalid address book [on line 114 of "/usr/share/php/Horde/SyncML/Sync.php"]
>  SyncML: api export call for 20050503180445.4pub50xbgow0 at webmin.gabelgaard.org failed:  Invalid address book [on line 187 of "/usr/share/php/Horde/SyncML/Sync.php"]

see my other mail on this one.

Cheers,
  Karsten

-- 
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

****************************************************************************
Virusscannet af mailFence fra Sure Solutions og der er ikke fundet vira (www.SureSolutions.dk)
****************************************************************************


More information about the sync mailing list