6.0.0-git
2021-01-19

[#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 2011-04-29 (3553 days ago)
Due
Updated 2011-05-13 (3539 days ago)
Assigned 2011-04-29 (3553 days ago)
Resolved 2011-04-29 (3553 days ago)
Milestone
Patch No

History
2011-05-13 04:18:11 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
2011-05-12 13:16:39 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.
2011-04-29 19:49:49 Michael Slusarz State ⇒ Resolved
 
2011-04-29 19:36:29 tomnet (at) tbuhl (dot) ch Comment #7 Reply to this comment
Your fix works also for me.
Thanks for helping!

- Tom
2011-04-29 17:30:17 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)


2011-04-29 16:22:15 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.
2011-04-29 16:22:14 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
2011-04-29 15:52:11 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

2011-04-29 12:37:44 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
2011-04-29 07:26:07 d (at) vidsolbach (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ SyncML in Horde 4 only does slow syncs
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
New Attachment: SyncML_only_does_slow_sync.tar.gz Download
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