6.0.0-alpha14
6/25/25

[#10194] Kronolith does not sync calendar, contacts work with Android 2.2.1/Motorola Milestone mobile
Summary Kronolith does not sync calendar, contacts work with Android 2.2.1/Motorola Milestone mobile
Queue Synchronization
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester le-horde (at) biz (dot) h42 (dot) net
Created 06/05/2011 (5134 days ago)
Due
Updated 07/29/2011 (5080 days ago)
Assigned 07/05/2011 (5104 days ago)
Resolved 07/10/2011 (5099 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/29/2011 06:47:50 AM mail (at) xeroc (dot) org Comment #41 Reply to this comment
Just upgraded to php5.3 using dotdeb.org packages.
Now latest GIT-MASTER is working without changes.

[request: fixed/closed]
07/10/2011 08:21:56 PM Michael Rubinsky Comment #40
State ⇒ Not A Bug
Reply to this comment
Agreed.
07/06/2011 08:48:06 AM Jan Schneider Comment #39 Reply to this comment
A crash is always PHP's fault. I doubt someone from PHP is going to 
look into this for an outdated PHP version in an outdated distribution 
though.
07/05/2011 11:06:04 PM Michael Rubinsky Comment #38
State ⇒ Assigned
Reply to this comment
Reopening during the time I am trying to track this down to something 
that can be either submitted to PHP as a bug report, or something in 
Horde_Date that can get fixed. After some irc debugging with a user 
who is experiencing this issue, we have come to the following:

The following *does* experience the issue on a debian lenny server:

$d = new Horde_Date('2011-07-08 15:00:00', 'Europe/Zurich');
$tz = $d->toDateTime()->getTimezone();
var_dump($tz);
var_dump($tz->getName());
var_dump($tz->getTransitions());
echo 'foobar';

The code dies at the $tz->getTransitions() line. In this case, the 
getName() call just returned an empty string.

If we break out the lower level code from Horde_Date that is actually 
being executed:

$date = new DateTime(null, new DateTimeZone('Europe/Zurich'));
$date->setDate(2011, 07, 08);
$date->setTime(15, 0, 0);
$tz = $date->getTimezone();
var_dump($tz);
var_dump($tz->getName());
var_dump($tz->getTransitions());
echo 'foobar';

*this* code runs without issue. This is the exact same code that is 
executed, with (supposedly) the same values, as is run by using 
Horde_Date. Something in Horde_Date is causing things to get mucked up.

Both scripts execute fine on a number of local servers, as well as the 
reporter's Debian Squeeze server
06/23/2011 05:03:04 PM Michael Rubinsky Comment #37
State ⇒ Not A Bug
Reply to this comment
This is a php issue, not horde.
06/23/2011 04:58:42 PM mail (at) xeroc (dot) org Comment #36 Reply to this comment
What is the value of $this->_timezone in 
framework/Date/lib/Horde/Date.php in the toDateTime method around 
line 280? If that is a valid timezone string, then yes, it is not a 
bug in Horde.
Just appended
++++++++++
echo "<hr>".$this->_timezone."<hr>";
++++++++++

and i am getting lots of UTC and a few "Europe/Berlin".
So I guess you can close the ticket resolved, as its an PHP issue. 
somehow, somewhere, no idea of fixing this one.
06/23/2011 04:41:22 PM Michael Rubinsky Comment #35 Reply to this comment
What is the value of $this->_timezone in 
framework/Date/lib/Horde/Date.php in the toDateTime method around line 
280? If that is a valid timezone string, then yes, it is not a bug in 
Horde.
06/23/2011 02:39:11 PM mail (at) xeroc (dot) org Comment #34 Reply to this comment
Sounds like maybe the timezonedb is corrupt.  If you installed the 
pecl timezonedb extension, try disabling it. If you are not using 
it, try installing it.
Didnt use it until now. Still get some random memory bytes.

I guess this is more a PHP/Debian issue and may not have to do 
anything with horde.
06/23/2011 02:29:48 PM Michael Rubinsky Comment #33 Reply to this comment
The interessting thing is the value of "$timezone->getName()" which 
should be "Europe/Berlin" but appears to be 'binary' crap from 
somewhere in the memory.
Sounds like maybe the timezonedb is corrupt.  If you installed the 
pecl timezonedb extension, try disabling it. If you are not using it, 
try installing it.
06/23/2011 02:25:24 PM Michael Rubinsky Comment #32 Reply to this comment
  > why the hell you set $timezone and not use it anywhere?

What makes you think it's not used just because you don't see the 
property name listed in one method or file?  It *is* used, by the 
parent class while encoding to the wbxml stream. It's also set by the 
parent class while decoding the wbxml stream from the device.

06/23/2011 12:20:58 PM mail (at) xeroc (dot) org Comment #31 Reply to this comment
What I dont get is the following code in
framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php

++++++++++++
157     public function setTimezone($date)
158     {
159         if (!($date instanceof Horde_Date)) {
160             $timezone = new Horde_Date(time(), $date);
161         }
162         $offsets = Horde_ActiveSync_Timezone::getOffsetsFromDate($date);
163         $tz = Horde_ActiveSync_Timezone::getSyncTZFromOffsets($offsets);
164         $this->_properties['timezone'] = $tz;
165     }
++++++++++++
why the hell you set $timezone and not use it anywhere?
06/23/2011 12:17:52 PM mail (at) xeroc (dot) org Comment #30 Reply to this comment
Your PHP is broken if it crashes on that.
Thats my guess was too.

I tested a little using the PHP-Shell:
####################
$tz = new DateTimeZone('Europe/Berlin');
var_dump($tz);
$date = new DateTime(null, new DateTimeZone('Europe/Berlin'));
var_dump($date);
$date->setDate(2011, 1, 10);
$date->setTime(18, 30, 0);
var_dump($date->getTimezone()->getName());
echo "<hr>";
$timezone = new DateTimeZone("Europe/London");
var_dump($timezone);
$transitions = $timezone->getTransitions();
print_r(array_slice($transitions, 0, 3));
####################

this script is working well.

Then I added a few lines to
framework/ActiveSync/lib/Horde/ActiveSync/Timezone.php in function 
getOffsetsFromDate()
after $timezone = $date->toDateTime()->getTimezone();
####################
echo "<hr>Horde_Date:\n";         var_dump($date);echo "<hr>";
echo "<hr>DateTime:\n";           var_dump($date->toDateTime());echo "<hr>";
echo "<hr>DateTimeZone:\n";       
var_dump($date->toDateTime()->getTimeZone());echo "<hr>";
echo "<hr>!!!!!!!!:\n";           var_dump($timezone->getName());echo "<hr>";
####################
The interessting thing is the value of "$timezone->getName()" which 
should be "Europe/Berlin" but appears to be 'binary' crap from 
somewhere in the memory.
####################
!!!!!!!!:
string(4) "??
"
####################

I set the timezone to Berlin with
$timezone = new DateTimeZone('Europe/Berlin');
and everything works well.

But this is not a 'nice' fix

I also reinstalled the php5 and php5-common packages using debian 
aptitude. No changes so far.
I also upgraded the pear packages using pear upgrad-all. no changes either.

What's next?
06/23/2011 11:34:56 AM Jan Schneider Comment #29 Reply to this comment
interessting is, that $timezone is an instance of DateTimeZone. So 
if this crashes this are wrong in pear.php.net/Date i guess. I
No, this is a method of the PHP date extension: 
http://www.php.net/manual/en/datetimezone.gettransitions.php

Your PHP is broken if it crashes on that.
06/23/2011 11:00:32 AM mail (at) xeroc (dot) org Comment #28 Reply to this comment
Things are getting weired.

I could find out, that the 'script-crash' was due to

framework/ActiveSync/lib/Horde/ActiveSync/Timezone.php
line 148: $transitions =$timezone->getTransitions();

interessting is, that $timezone is an instance of DateTimeZone. So if 
this crashes this are wrong in pear.php.net/Date i guess. I 
reinstalled it using force flag. No change :(

gonna keep you posted
06/23/2011 10:35:50 AM mail (at) xeroc (dot) org Comment #27 Reply to this comment
Good news:
I got it to work

Bad news:
I had to comment out a line of code:

in "kronolith/lib/Event.php"
in the public method "public function toASAppointment()"
i commented out

// $message->setTimezone($this->start);


When I saw this I remembered that there was something about converting 
to UTC in the configs. I ran the convert script provieded in the 
kronolith/bin/ folder. I guess it changed some sql values (dont know 
for sure), but things didn't work better. So i decided to comment this 
line out. Et voila.

Hope I can help you fix the issue.
06/23/2011 10:17:59 AM mail (at) xeroc (dot) org Comment #26 Reply to this comment
If I use x-vcalendar instead everything works fine:

$event = $registry->calendar->export('kqnpeoc8ti9bhmoph23dei383c@xeroc.org',
'text/x-vcalendar');
var_dump($event);

I get:
++++++++++++
PHP Code
1
2
3

$event = $registry->calendar->export('kqnpeoc8ti9bhmoph23dei383c@xeroc.org',
'text/x-vcalendar');
var_dump($event);

Ergebnisse

string(449) "BEGIN:VCALENDAR
VERSION:1.0
X-WR-CALNAME:Kalender von XXXXXXXXXXX
PRODID:-//The Horde Project//Horde iCalendar Library//EN
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART:20110110T183000Z
DTEND:20110110T193000Z
DTSTAMP:20110623T101053Z
UID:kqnpeoc8ti9bhmoph23dei383c@xeroc.org
SUMMARY:Chorprobe
ORGANIZER;CN=...........XXXXXBlackedOutXXXXXXX............
CLASS:PUBLIC
STATUS:TENTATIVE
TRANSP:0
RRULE:W1 MO 20160110T225959Z
END:VEVENT
END:VCALENDAR
"

06/23/2011 10:09:40 AM mail (at) xeroc (dot) org Comment #25
New Attachment: horde.log Download
Reply to this comment
Just switched back to DEBUG logging.
Nothing strange either.

I ran the SQL command that hast the event_id manually and there is the 
same dataset returned as in the ticket befor

Appended the log
06/23/2011 10:02:02 AM mail (at) xeroc (dot) org Comment #24 Reply to this comment
I tried:  (I added some more events. So this one has the uid thats 
fails - first to be transfered)
$event = 
$registry->calendar->export('kqnpeoc8ti9bhmoph23dei383c@xeroc.org', 
'activesync')
But seems to fail with no warning/error on neither horde-log nor apache log.
The only reaction is firefox wanting to download a 'phpshell.php' file 
which is empty.
To check the shell I tried a single 'echo "foobar";' which was working 
as expected.

This is the SQL entry (fetched directly from sql-db):

INSERT INTO `kronolith_events` (`event_id`, `event_uid`, 
`calendar_id`, `event_creator_id`, `event_description`, 
`event_location`, `event_status`, `event_attendees`, `event_keywords`, 
`event_exceptions`, `event_title`, `event_recurtype`, 
`event_recurinterval`, `event_recurdays`, `event_recurenddate`, 
`event_recurcount`, `event_start`, `event_end`, `event_alarm`, 
`event_modified`, `event_private`, `event_allday`, 
`event_alarm_methods`, `event_url`, `event_baseid`, 
`event_exceptionoriginaldate`, `event_resources`) VALUES
('fiH5UzMRB6ROANTIgXvhIFA', 'kqnpeoc8ti9bhmoph23dei383c@xeroc.org', 
'QYe5aTMRB6ROAEpgpqU3pyA', 'mail@xeroc.org', '', '', 1, 'a:0:{}', 
NULL, '', 'Chorprobe', 2, 1, 2, '2016-01-09 23:00:00', NULL, 
'2011-01-10 18:30:00', '2011-01-10 19:30:00', 0, 1308677318, 0, 0, 
'N;', '', '', NULL, 'a:0:{}');


06/23/2011 02:22:43 AM Michael Rubinsky Comment #23 Reply to this comment
2011-06-21T18:45:49+02:00 DEBUG: [androidc816936759] Found 1 message 
changes, checking for PIM initiated changes.
2011-06-21T18:45:49+02:00 DEBUG: [androidc816936759] No PIM changes 
present, returning all messages.
2011-06-21T18:45:49+02:00 DEBUG: Horde::getMessage(Calendar, 
20110621181107.emUPWjMRB6ROAMKbWQH30DA@horde.xeroc.org)
#############
Ok. From the phpshell available in Horde (horde/admin/phpshell.php) 
try running this (assuming that this event still exists in your 
database, if not, use the event_uid from another one of the log 
entries like above):

$event = 
$registry->calendar->export('20110621181107.emUPWjMRB6ROAMKbWQH30DA@horde.xeroc.org', 
'activesync');

var_dump($event);


post back what happens.


06/22/2011 09:22:45 PM Michael Rubinsky Comment #22 Reply to this comment

Well, not according to the posted log. Regardless, the point is that 
something is failing within kronolith's scope, while trying to fetch a 
single event.
06/21/2011 09:46:15 PM mail (at) xeroc (dot) org Comment #21 Reply to this comment
This is the same failure mode as Bug: 10263
I don' think so ... His transfer stop after several events I thought. 
Here it is stuck during the very first. Not depending on the event 
(tested several different one (generated in google,kronologh,manually))
06/21/2011 05:19:40 PM Michael Rubinsky Comment #20 Reply to this comment
This is the same failure mode as Bug: 10263
06/21/2011 04:48:17 PM mail (at) xeroc (dot) org Comment #19
New Attachment: activesync[5].log Download
Reply to this comment
Seems like samsungs android 2.2 needs the 'sync antomaticly' options enabled.
Anyway. Lots of logslines are produced.
calendar is produced on android. But existing events are not imported.

These lines are produced over and over:
#############
2011-06-21T18:45:49+02:00 DEBUG: [androidc816936759] Found 1 message 
changes, checking for PIM initiated changes.
2011-06-21T18:45:49+02:00 DEBUG: [androidc816936759] No PIM changes 
present, returning all messages.
2011-06-21T18:45:49+02:00 DEBUG: Horde::getMessage(Calendar, 
20110621181107.emUPWjMRB6ROAMKbWQH30DA@horde.xeroc.org)
#############
06/21/2011 04:16:12 PM mail (at) xeroc (dot) org Comment #18
New Attachment: horde-sync-initial.log Download
Reply to this comment
Initial Log - right after setting active sync up on android
06/21/2011 04:14:44 PM mail (at) xeroc (dot) org Comment #17
New Attachment: activesync[4].log Download
Reply to this comment
Thanks for the git commit.

Things didn't change though.

Reproduction:
  - Use a new mail - user (horde@xeroc.org)
  - Setup android to sync with it.
  - The initial synclog is attached
  - after a few minutes, as there was still no new calendar appearing 
in android hit the sync calendar button manually
  - log file did not change ( :-( )
  - after a few more minutes hit the sync contacts button
  - things changed in log file (log attached)
  - after a few minutes, hit the sync calendar button manually again
  - log file did not change
  - calendar still not appearing in android
06/21/2011 04:00:54 PM Michael Rubinsky Comment #16 Reply to this comment
This last commit might help some of the issues reported here. Please 
try a completely fresh sync (new account on phone, clear devices in 
Horde etc...).

If still experiencing problems, I will need a dump of the event 
database to ensure nothing funny is causing problems there.

06/21/2011 02:58:21 PM Git Commit Comment #15 Reply to this comment
Changes have been made in Git for this ticket:

Revert "Another small android workaround."
Need to keep this entry, at least temporarily. Otherwise,
initial setup can fail on some android devices that incorrectly
attempt to provision (even though they don't actually support it),
then (again, incorrectly) perform a FOLDERSYNC that is actually
ignored by the client anyway. Yay standards.

Hopefully helps at least some of the issues being reported in
Bug: 10194
This reverts commit 736800574f6cc05570266ce8adb8bbbc6aa120fc.

  1 files changed, 1 insertions(+), 4 deletions(-)
http://git.horde.org/horde-git/-/commit/7f69397f8b41e1e34334aa92ea9a3d6de81416db
06/21/2011 08:00:16 AM mail (at) xeroc (dot) org Comment #14
New Attachment: activesync[3].log Download
Reply to this comment
Reproduction:
  - Delete all contact books (one is auto-regenerated empty)
  - Delete all calendars (one is auto-regenerated empty)
  - Delete all coupled active sync devices in horde
  - Delete ActiveSync Source in Android
  - StartOver from scratch:
  - Reboot Android
  - add the ActiveSync Source in Android
  - Wait 10 minutes to finish inital sync
  - add a contact in addressbook
  - add an event in calendar
  - press 'sync' in android
  - wait
  - no changes in calendar
  - even no changes in contacts this time (maybe due to this error: 
ERR: Ungültiges Adressbuch: NQZXETMRB6RN_kiPCU4AxEA) Where ever it 
came from

  - full activesync log appended

06/21/2011 06:49:46 AM mail (at) xeroc (dot) org Comment #13
New Attachment: activesync[2].log Download
Reply to this comment
Running git version 141b088dfea802b1d72fbbc8576fa8ae675a04b0

No look with Touchdown either.

I let android it do what ever it was doing the whole night. No 
horde-calendar calendar entries synced.

The attached file is the activesync log using touchdown für android 2.x
06/20/2011 05:33:27 PM mail (at) xeroc (dot) org Comment #12 Reply to this comment
The second thing is the "2011-06-20T17:55:24+02:00 ERR: Zugriff 
verweigert" entry in the sync logs. This sounds like an issue with 
authentication that was already fixed. Though since you say you are 
using git master, this might be a new issue. Probably something to 
do with Horde sessions. What authentication backend are you using, 
what session backend, and are you using cookie based sessions?
I may have done a mistake by replying to others bug reports. I am 
currently working to get the git master to work. I did not use it 
before. More info to come.
06/20/2011 04:43:47 PM Michael Rubinsky Comment #11
State ⇒ Feedback
Reply to this comment
There are a few funny things happening in this log. First, the client 
is issuing a PING request immediately after the FOLDERSYNC. This is 
incorrect, at least for version 2.5 of ActiveSync. At least one SYNC 
request needs to be issued before a PING. This might be a side effect 
of some other issue...

The second thing is the "2011-06-20T17:55:24+02:00 ERR: Zugriff 
verweigert" entry in the sync logs. This sounds like an issue with 
authentication that was already fixed. Though since you say you are 
using git master, this might be a new issue. Probably something to do 
with Horde sessions. What authentication backend are you using, what 
session backend, and are you using cookie based sessions?
06/20/2011 04:10:08 PM mail (at) xeroc (dot) org Comment #10
New Attachment: activesync[1].log Download
Reply to this comment
It is the client's responsibility to initiate a SYNC request. From 
the small log already posted, it looks like the calendar folder is 
properly being initialized.
I see.
I can not reproduce this at all on any of my test devices, including 
android. At least one dev is using the Milestone without any issues 
as well.  Make sure you didn't miss anything in both the sync log 
AND the general horde log.
That sounds goog for me because I am using a GalaxyTab.
To make sure the server is working correctly, you can try to use the 
Touchdown application (trial available in Android Market) and see if 
calendar sync works better for you. It has a far more complete 
calendar implementation then the buggy stock android calendar.
No errors in apache. Not working with Touchdown.
I attached the activesync log that was written while Touchdown syned.

I am going to try the latest git tag maybe the bug is already fixed.


06/20/2011 02:50:28 PM Michael Rubinsky Comment #9 Reply to this comment
It is the client's responsibility to initiate a SYNC request. From the 
small log already posted, it looks like the calendar folder is 
properly being initialized.

I can not reproduce this at all on any of my test devices, including 
android. At least one dev is using the Milestone without any issues as 
well.  Make sure you didn't miss anything in both the sync log AND the 
general horde log.

To make sure the server is working correctly, you can try to use the 
Touchdown application (trial available in Android Market) and see if 
calendar sync works better for you. It has a far more complete 
calendar implementation then the buggy stock android calendar.
06/20/2011 07:29:25 AM mail (at) xeroc (dot) org Comment #8 Reply to this comment
later on the android app does not even try to sync the calendar.
Can confirm that here too,

Horde logs do nothing besides
+++++++++++++++++
2011-06-20T09:28:14+02:00 DEBUG: [androidc816936759] Initializing 
message diff engine for Contacts
2011-06-20T09:28:14+02:00 DEBUG: 
Horde_ActiveSync_Driver_Horde::getServerChanges(Contacts, 1308554796, 
1308554894, 0)
2011-06-20T09:28:14+02:00 DEBUG: [androidc816936759] Found 0 message 
changes, checking for PIM initiated changes.
2011-06-20T09:28:14+02:00 DEBUG: [androidc816936759] No PIM changes 
present, returning all messages.
+++++++++++++++++
Even if I hit the 'Sync calendar now' button a few times.

If i hit the 'Sync contacts now' lots of lines are logged to the 
activesync log.

Anything more i can tell you for bugtracking?
06/19/2011 09:40:53 PM le-horde (at) biz (dot) h42 (dot) net Comment #7 Reply to this comment
I can confirm, that there is nothing in the horde logs regarding sync 
errors. It seems as if something is missing in the initial setup and 
later on the android app does not even try to sync the calendar.
06/19/2011 08:15:14 PM mail (at) xeroc (dot) org Comment #6 Reply to this comment
I actualy meant: nothing on the horde configs so far.
Oh boy.. Too late for me now. LOGs ... I mean LOGs
06/19/2011 08:12:41 PM mail (at) xeroc (dot) org Comment #5 Reply to this comment
have the same problem here. nothing suspicious in the horde configs so far.
I actualy meant: nothing on the horde configs so far.

I use kronolith 3.0.4 on horde 4.0.6
06/18/2011 10:08:01 PM mail (at) xeroc (dot) org Comment #4 Reply to this comment
have the same problem here. nothing suspicious in the horde configs so far.
06/15/2011 03:15:12 PM Michael Rubinsky State ⇒ No Feedback
 
06/06/2011 06:03:33 PM Michael Rubinsky Comment #3
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
Works fine here. The log provided shows a successful FOLDERSYNC only.
Any errors in the Horde log?
06/05/2011 10:28:58 AM le-horde (at) biz (dot) h42 (dot) net Comment #2
New Attachment: activesync.log Download
Reply to this comment
The activesync log of the initial setup.
06/05/2011 10:20:33 AM le-horde (at) biz (dot) h42 (dot) net Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Kronolith does not sync calendar, contacts work with Android 2.2.1/Motorola Milestone mobile
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
Reply to this comment
Hi,

I have a motorola milestone mobile phone with firmware 2.2.1. I am 
trying to setup Horde ActiveSync to synchronize contacts and calendar 
entries. I created a corresponding profile on my mobile, setup 
completes without errors. Syncing contacts is successful afterwards in 
both directions but nothing happens with calendar entries. If I 
initiate a manual sync, nothing happens, I don't even see traffic from 
the mobile to my server via tcpdump.

I've attached the activesync log of the initial setup. I've reset the 
settings several times. No joy...

Cheers,
Lars

Saved Queries