6.0.0-git
2019-04-25

[#10461] Sync with SonyEricsson ELM (ActiveSync)
Summary Sync with SonyEricsson ELM (ActiveSync)
Queue Synchronization
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester michael.groene (at) zel (dot) uni-hannover (dot) de
Created 2011-08-26 (2799 days ago)
Due
Updated 2011-09-10 (2784 days ago)
Assigned 2011-08-28 (2797 days ago)
Resolved 2011-09-02 (2792 days ago)
Milestone
Patch No

History
2011-09-10 14:43:08 Git Commit Comment #12 Reply to this comment
Changes have been made in Git for this ticket:

one more place to fix this constant
Bug: 10461

  1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/4f6f19ec8107bc1fa18cebb3e973c456999a7016
2011-09-09 16:54:37 Michael Rubinsky Comment #11 Reply to this comment
Some little misstakes are in Sync.php though:
[09-Sep-2011 16:17:25] PHP Fatal error:  Undefined class constant 
'SYNC_STATUS_PROTERROR' in 
/var/www/horde4/pear/php/Horde/ActiveSync/Request/Sync.php on line 233
I already fixed at least one of those constants, along with some other 
improvements. I'll check on the other one tonight.
2011-09-09 16:15:23 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #10 Reply to this comment
Seems to work better, for calendars, contacts won't work correctly, 
but I will test a little bit more, next week.

Some little misstakes are in Sync.php though:
[09-Sep-2011 16:17:25] PHP Fatal error:  Undefined class constant 
'SYNC_STATUS_PROTERROR' in 
/var/www/horde4/pear/php/Horde/ActiveSync/Request/Sync.php on line 233

Think it should be self::STATUS_PROTERROR.
Same goes for line 99
2011-09-09 14:53:37 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #9 Reply to this comment
Seems to work better, for calendars, contacts won't work correctly, 
but I will test a little bit more, next week.

Some little misstakes are in Sync.php though:
[09-Sep-2011 16:17:25] PHP Fatal error:  Undefined class constant 
'SYNC_STATUS_PROTERROR' in 
/var/www/horde4/pear/php/Horde/ActiveSync/Request/Sync.php on line 233

Think it should be self::STATUS_PROTERROR.
Same goes for line 99
2011-09-02 23:16:30 Michael Rubinsky Comment #8
State ⇒ Resolved
Priority ⇒ 1. Low
Reply to this comment
I've added some safe guards to prevent the incoming changes from being 
applied during the synckey 0 sync. This was the cause of the 500 
error. The other duplicate key error was a result of the first error 
and is expected. I've tweaked the log message to make it sound less 
disastrous though.

Since this is a client issue, not sure what else I can do from the Horde side.
2011-09-02 17:22:56 Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

some logging to possibly help track down Bug: 10461

  1 files changed, 2 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/8a509451c494aed7ed43d255ecb488aff79d71ce
2011-09-02 17:22:53 Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Prevent broken clients from corrupting server data.
Related to Bug: 10461

  1 files changed, 9 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/5a2dbd66982a3dc71f5df3c31ed990f744cd9d05
2011-09-02 16:57:04 Michael Rubinsky Comment #5 Reply to this comment
And after I reset the device in user preferences, the first sync, 
see attachment
This log looks like a broken client. Under no circumstances should a 
client send a synckey of '0' AND incoming changes. A synckey of 0 is 
only sent during an initial sync handshake, or when resetting the 
client state on the server (as when the a client's account is reset).

According the the AS docs:
A synchronization key of value 0 initializes the synchronization state 
on the server and causes a full synchronization of the collection. The 
server sends a response that includes a new synchronization key value.

Sending a set of changes from the client to the server during a 
synchronization initialization makes no sense, since the entire client 
database is considered empty at this point.

What your log shows is this: First, the server is sending a KEYMISM 
error, which means that the server received an invalid or expired 
synckey (this might be due to the previous errors you experienced, or 
from resetting the account). What is supposed to happen next is that 
the client wipes the local datastore and the server sends all items to 
the device.
2011-08-28 10:03:46 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #4
New Attachment: ac_after_reset.log Download
Reply to this comment
And after I reset the device in user preferences, the first sync, see 
attachment
2011-08-28 10:02:40 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #3
New Attachment: ac_anothertry.log Download
Reply to this comment
Please provide a full sync log. The error that is causing these 
issues likely occurs earlier in the log.
Hmm, I don't really see other errors, but see attachment.
2011-08-28 00:51:30 Michael Rubinsky Version ⇒ Git master
Queue ⇒ Synchronization
 
2011-08-28 00:50:55 Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
Please provide a full sync log. The error that is causing these issues 
likely occurs earlier in the log.
2011-08-26 13:13:38 michael (dot) groene (at) zel (dot) uni-hannover (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Sync with SonyEricsson ELM (ActiveSync)
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
Reply to this comment
I'm trying to sync my phone's calendar and contacts with horde.

The phone gets connected successfully to the server, but the process 
of syncing will fail at some point.
In activesync-log I could following entries, which might be related to 
the issue:

first:
2011-08-26T15:00:07+02:00 DEBUG: Horde::changeMessage(Contacts, )
2011-08-26T15:00:07+02:00 DEBUG: 
ActiveSync_Driver_Horde::_smartStatMessage:Contacts:20110826150007.e-9jZ9cNCvpOV5jXl9fjSLA@horde4.uni-hannover.de
2011-08-26T15:00:07+02:00 DEBUG: Updating state during change
2011-08-26T15:00:07+02:00 ERR: QUERY FAILED: Column 'sync_key' cannot be null

INSERT INTO horde_activesync_map (message_uid, sync_modtime, sync_key, 
sync_devid, sync_folderid, sync_user) VALUES 
('20110826150007.e-9jZ9cNCvpOV5jXl9fjSLA@horde4.uni-hannover.de', 
1314363607, NULL, 'SEMC359874037050544', 'Contacts', 
'michael.groene@uni-hannover.de')
2011-08-26T15:00:07+02:00 ERR: Returning HTTP 500:QUERY FAILED: Column 
'sync_key' cannot be null

INSERT INTO horde_activesync_map (message_uid, sync_modtime, sync_key, 
sync_devid, sync_folderid, sync_user) VALUES 
('20110826150007.e-9jZ9cNCvpOV5jXl9fjSLA@horde4.uni-hannover.de', 
1314363607, NULL, 'SEMC359874037050544', 'Contacts', 
'michael.groene@uni-hannover.de')
2011-08-26T15:00:07+02:00 INFO: User michael.groene@uni-hannover.de logged off


And in another try I got this:
2011-08-26T15:03:53+02:00 DEBUG: [SEMC359874037050544] Saving state: Array
(
     [0] => {4e579931-6998-4e68-9eeb-3b64824b99b2}2
     [1] =>
     [2] => SEMC359874037050544
     [3] => 0
     [4] => Contacts
     [5] => michael.groene@uni-hannover.de
)

2011-08-26T15:03:53+02:00 ERR: [SEMC359874037050544] Error saving 
state for synckey {4e579931-6998-4e68-9eeb-3b64824b99b2}2: QUERY 
FAILED: Duplicate entry '{4e579931-6998-4e68-9eeb-3b64824b99b2}2' for 
key 'PRIMARY'

INSERT INTO horde_activesync_state (sync_key, sync_data, sync_devid, 
sync_time, sync_folderid, sync_user) VALUES 
('{4e579931-6998-4e68-9eeb-3b64824b99b2}2', '', 'SEMC359874037050544', 
0, 'Contacts', 'michael.groene@uni-hannover.de')
2011-08-26T15:03:53+02:00 DEBUG: O   <Folders/>
2011-08-26T15:03:53+02:00 DEBUG: O  <Synchronize/>
2011-08-26T15:03:53+02:00 INFO: User michael.groene@uni-hannover.de logged off


Any ideas?

Saved Queries