6.0.0-beta1
7/7/25

[#10008] SyncML in Horde 4 only does slow syncs
Summary SyncML in Horde 4 only does slow syncs
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners
Requester d (at) vidsolbach (dot) de
Created 04/29/2011 (5183 days ago)
Due
Updated 05/13/2011 (5169 days ago)
Assigned 04/29/2011 (5183 days ago)
Resolved 04/29/2011 (5183 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/13/2011 04:18:11 AM Git Commit Comment #9 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10008: DB query might be empty

  1 files changed, 9 insertions(+), 8 deletions(-)
http://git.horde.org/horde-git/-/commit/a1bafdb2e26b85a7c44bc71944cab7f6c1a7a8b9
05/12/2011 01:16:39 PM fritz (at) praus (dot) at Comment #8 Reply to this comment
I think, there still is a problem:

public function readSyncAnchors($databaseURI)
             $res = $this->_db->selectOne($query, $values);
             return array(
                 $res['syncml_clientanchor'],
                 $res['syncml_serveranchor']
             );

This returns an array.

In Line 537 in
public function writeSyncAnchors($databaseURI, $clientAnchorNext,
                               $serverAnchorNext)
there is an
  if (!$this->readSyncAnchors($databaseURI))


Hence, this fix only works, if an entry is already present and only 
UPDATE is called. If no entry is present, there will never be an 
INSERT and thus only slow sync occurs.
04/29/2011 07:49:49 PM Michael Slusarz State ⇒ Resolved
 
04/29/2011 07:36:29 PM tomnet (at) tbuhl (dot) ch Comment #7 Reply to this comment
Your fix works also for me.
Thanks for helping!

- Tom
04/29/2011 05:30:17 PM d (at) vidsolbach (dot) de Comment #6 Reply to this comment
Looks like the real issue is in Horde_SyncMl_Backend_Horde.  See if 
this patch fixes things.
The patch fixed the problem for me! (although the previous change from 
the previous comment did it, too)


04/29/2011 04:22:15 PM Michael Slusarz Comment #5
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
$r seems to be a Associative array.
Then this is wrong, since readSyncAnchors() clearly states it needs to 
be a two element array.  So your fix isn't correct.

Looks like the real issue is in Horde_SyncMl_Backend_Horde.  See if 
this patch fixes things.
04/29/2011 04:22:14 PM Git Commit Comment #4 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10008: Fix issue causing slow syncs only

  2 files changed, 10 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/c849aaf457003d830f208eba0c8625339575a8b8
04/29/2011 03:52:11 PM tomnet (at) tbuhl (dot) ch Comment #3 Reply to this comment

[Show Quoted Text - 11 lines]
EDIT:

Got it working (for me at last) by changing line 166 (the list() 
function with the two lines:

$clientlast = $r[syncml_clientanchor];
$serverAnchorLast = $r[syncml_serveranchor];

$r seems to be a Associative array.

- Tom

04/29/2011 12:37:44 PM tomnet (at) tbuhl (dot) ch Comment #2 Reply to this comment
I took some time to dive a little bit into this.
It looks like the Function
  list($clientlast, $serverAnchorLast) = $r;
  on line 166 of Command/Alert.php ist not performing as expected.
The array seems to be there in $r, because adding
  . implode ("||",$r);
in the logMessage (line167) issuses both values as recorderd in the Database.
But the variables $clientlast and $serverAnchorLast are still empty 
when printed in the logMessage.

  -Tom
04/29/2011 07:26:07 AM d (at) vidsolbach (dot) de Comment #1
State ⇒ Unconfirmed
New Attachment: SyncML_only_does_slow_sync.tar.gz Download
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ SyncML in Horde 4 only does slow syncs
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Horde only does slow syncs with my N900 client (syncevolution), but 
other users have reported similar problems on the mailing lists. As 
Jan stated, it seems that Horde fails to read the timestamp of the 
last sync from the database.

I tried to produce a clean log. Here is what I did:

1. rm everything in /tmp/sync
2. horde log output set to "Debug"
3. dropped all horde_syncml tables and recreated them using the horde
configuration and deleted all turba contacts and calender items
4. deleted everything in ~/.cache/syncevolution on the n900
5. manually initiated slow sync with syncevolution with

'syncevolution --sync refresh-from-client  <myconfigname>'

That worked flawlessly.

6. Initiated a "normal" two-way sync with 'syncevolution <myconfigname>'

Same problem again. Horde can't seem to find the timestamp:

UNKNOWN:Previous sync found for database contacts; client timestamp:
UNKNOWN:Client requested sync with anchor timestamp 20110426T173321Z 
but server has recorded timestamp . Enforcing SlowSync

Attached to this bug there is a tarball which contains:

- Horde /tmp/sync folder contents (synclogs.tgz)
- Syncevolution output during slow sync (syncevolution_output_slow_sync)
- Syncevolution output during normal sync (syncevolution_output_normal_sync)
- content of the horde_* database tables (horde_syncml.sql)

Saved Queries