I am using Calendar
on a Mac running MacOS X Mountain Lion (10.8.5).
This Mac is manually regularly synchronized with an iPhone running iOS 7.1.2.
This Calendar
is storing 15 years of events organized within 9 "calendars". Since some of this information is highly sensitive, professionnal or private, I don't synchronize them on any form of public store calendar (iCloud
, Google Calendar
…). On the other hand I have many Time Machine
backups and full backups.
Recently I discovered quite unexpectedly that since summer 2001 I have duplicated full day events within Calendar
on my Mac. I have been able to see these ones quickly since their duplicate nature is directly visible. This isn't a general case: most of my full day events aren't
duplicated. But all my 9 "calendars" are hit by this corruption.
I estimate that I have about a few hundreds of events in this case.
I see the same corruption on my iPhone.
I exported one of my calendar, and extracted one of the duplicated entries. Here is the output of a diff on the 2 .ics
extracts:
••My_Mac••$ diff duplicate.[12].ics
2c2
< UID:74FC7CC1-016C-4A74-9E02-7ECDD82C8129
---
> UID:9B6BC4CD-5859-4DC2-8DEA-9158CB8F9B0D
10,11c10,11
< X-WR-ALARMUID:D0FE4A14-981C-4409-84C1-B11107F7EC31
< UID:D0FE4A14-981C-4409-84C1-B11107F7EC31
---
> X-WR-ALARMUID:48141767-C3C6-4131-9984-0DD080833D9F
> UID:48141767-C3C6-4131-9984-0DD080833D9F
••My_Mac••$
Notation: the string ••
name••
means that "name" was redacted.
Here is what I found within /var/log/system.log
and which might be related:
Sep 13 10:08:32 ••My_Mac•• SyncServer[93677]: [0x7fbe60c0bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 13 16:09:10 ••My_Mac•• SyncServer[94189]: [0x7fd25a40bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 14 03:21:15 ••My_Mac•• SyncServer[94351]: [0x7f9e1ac0bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 14 08:56:41 ••My_Mac•• SyncServer[94351]: [0x7f9e1ac0bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 15 14:11:39 ••My_Mac•• SyncServer[94351]: [0x7f9e1ac0bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 16 00:25:17 ••My_Mac•• SyncServer[95764]: [0x7faf92c0bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 16 13:36:27 ••My_Mac•• SyncServer[96213]: [0x7f9470c0bdd0] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert. Sep 16 13:51:33 ••My_Mac•• CalendarAgent[90827]: Invalid char _ for PropertyName in line 7 Sep 16 13:51:33 ••My_Mac•• CalendarAgent[90827]: Unexpected EOF, returning last token as fallback
How may I analyse where these duplicates events are coming from?
How may I find the date and time an event might have started such a corruption of my agendas? Without a date of the beginning of the damage, my backups are of little help. Moreover, they will imply a total rebuild of the correct events which occured after the damage.
How may I get a correct vision of this corruption of all my "calendars"?
And moreover how may I fix this huge and apparently random data corruption?
Best Answer
I haven't yet a correct explanation of these corruptions, but at least I wrote a solution to have a clear vision of the extent of the damage and to fix it.
Here is a perl script:
duplicate.pl
:And here is the way I used it:
From
Calendar
, export a given calendar through:File > Export > Export...
let's say it is:
Documents/Calendar/2015/professionnal.ics
NB.: this will be a backup in case of problem, and a much more practical one than any file manipulation with the help of
Time Machine
Install the above script as:
Go in directory to test for fixed version, for example:
Run
duplicate.pl
:which will display the number of events read and the number of duplicate found and create here a fixed version of the calendar:
Compare the result with the original corrupted version to check everything is OK:
Within
Calendar
select the calendarprofessionnal
and delete it through:Edit > Delete
Import the fixed one through:
File > Import > Import...