I’ve been getting lots of synchronization errors, failures, and duplicate events and calendars. (102 calendars, a dozen of which were legitimate.) Someone at the BusyCal booth at MacWorld said the new MobileMe calendar format was much less data-corrupting, but the upgrade process failed, so I've tried some drastic pruning. For duplicate events, iCal Cleaner can delete all intra-calendar duplicates, at least in small calendars. iCal Dupe Deleter can handle a large calendar, but only one at a time. Neither handles inter-calendar duplicates. For duplicate calendars, which may be due to Guided Ways’ 2Do’s flakey Wifi synchronization, I'm trying a semi-manual purge. There are iCalendar validators on the web, but none that run locally, and I'd rather not entrust seventeen years of personal data to a server, unless I really have to. (A small calendar passed validation.)
For large calendars with interesting data, I run the following AppleScript , then copy the log output to a BBEdit document it, massage it by inserting line-breaks, and then sort. Repeat, and diff.
tell application "iCal" set ThisCal to "Calendar name here" set theCalendarCount to count of events in calendar ThisCal set theTitles to summary of every event in calendar ThisCal end tell
This sometimes hangs, but after finishing. It also sometimes misses events; three times an event showed up in the diffs as being in a bogus calendar, but not the original, when an iCal search turned it up in both places.
For shorter calendar(s), I simply check it/them in the Calendar list, and search for "e". The type icon distinguishes events (which I care about) from ToDos, which I will bulk delete, and restore from 2Do. I assumed a non-empty calendar would have at least one meeting with an "e" in it, though one did have only the single event "judging".
Once I see which duplicate calendar deserves to be nuked (occasionally I had to manually move a couple of meetings from the runner-up to the winner), I export it, using a Keyboard Maestro macro plus two Enters. (A system keyboard shortcut doesn't work, since Export appears at two levels of the hierarchy.) Then I select Delete (also with a macro) and enter.
I then nuked all the ToDos in all the calendars; I’ll restore them eventually from ToDo on the device.
This eventually allowed me to upgrade my MobileMe calendar on the second try. Resetting Sync Data on my second Mac worked badly several times, with lots of duplicates. I ended up following a suggestion to delete the Library calendar and cache files, and eventually the prefs file as well. Even then, syncing resulted in a lot of duplicates, so I restored from a backup and reset the sync data yet again.
Feb 24 10:10:12 Satrazon AppleMobileBackup[34537]: ERROR: Backup cancelled (com.apple.MobileBackup.ErrorDomain/202) Feb 24 10:10:12 Satrazon AppleMobileBackup[34537]: ERROR: Backup error: -21 Feb 24 10:10:12 Satrazon [0x0-0x48a48a].com.apple.iTunes[17656]: 2011-02-24 10:10:12.471 AppleMobileBackup[34537:903] ERROR: Backup cancelled (com.apple.MobileBackup.ErrorDomain/202) Feb 24 10:10:12 Satrazon [0x0-0x48a48a].com.apple.iTunes[17656]: 2011-02-24 10:10:12.471 AppleMobileBackup[34537:903] ERROR: Backup error: -21 Feb 24 10:10:12 Satrazon /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/Current/AppleMobileDeviceHelper.app/Contents/Resources/AppleMobileBackup[34537]: 34537:1889250464|DeviceLinkConnection.c:_DLMainThreadMessagePortCallback| ERROR: Error creating components from read data: 'NULL data returned from read' Feb 24 10:10:12 Satrazon AppleMobileBackup[34537]: ERROR: Connection to device lost (com.apple.MobileBackup.ErrorDomain/200) Feb 24 10:10:12 Satrazon [0x0-0x48a48a].com.apple.iTunes[17656]: 2011-02-24 10:10:12.513 AppleMobileBackup[34537:903] ERROR: Connection to device lost (com.apple.MobileBackup.ErrorDomain/200) Feb 24 10:11:00 Satrazon iTunes[17656]: INSERT-HANG-DETECTED: Tx time:21.466547, # of Inserts: 17, # of bytes written: 124490, Did shrink: YESthen
Feb 24 10:45:14 Satrazon mdworker[34578]: Could not initialize source from /Users/flash/Library/Application Support/AddressBook/Sources/7A414D8C-930B-4AA0-9E13-CE51D22FBAA6 Feb 24 10:46:49 Satrazon com.apple.usbmuxd[44]: MuxSendToClient send failed for 0xf-eea7e6fd0cae651006d18ba67e63b09a0189b931@0xfd300000:49224->0x10102c0a0-iTunes/com.apple.iTunes:5663: 32 - Broken pipeGot better after rebooting the iPhone and quitting iTunes.
After trying the suggested workaround, syncing my iPhone to MobileMe (which I wanted to avoid; previous attempts at MobileMe syncing on my iPhone were buggy), I get a bus error when I launch Calendar:
Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x00000024 Crashed Thread: 0 Thread 0 Crashed: 0 AppSupport 0x309ebfc8 0x309e4000 + 32712 1 EventKit 0x343ae8e8 0x3438c000 + 141544 2 EventKit 0x343adb06 0x3438c000 + 137990 3 EventKit 0x343adc94 0x3438c000 + 138388 4 CoreFoundation 0x3148e588 0x31430000 + 386440 5 EventKit 0x343ada0a 0x3438c000 + 137738 6 AppSupport 0x309e810a 0x309e4000 + 16650 7 EventKit 0x343acbee 0x3438c000 + 134126 8 libSystem.B.dylib 0x3123ccdc 0x31165000 + 883932 9 EventKit 0x343ad53c 0x3438c000 + 136508 10 EventKitUI 0x36023f5e 0x36016000 + 57182 11 MobileCal 0x00008892 0x1000 + 30866 12 MobileCal 0x000086bc 0x1000 + 30396 13 MobileCal 0x0000830a 0x1000 + 29450 14 MobileCal 0x00007f96 0x1000 + 28566 15 MobileCal 0x00006c9c 0x1000 + 23708 16 Foundation 0x31cd861c 0x31cc4000 + 83484 17 CoreFoundation 0x3145711c 0x31430000 + 160028 18 CoreFoundation 0x31456dbc 0x31430000 + 159164 19 Foundation 0x31cc7d1c 0x31cc4000 + 15644 20 Foundation 0x31cd123a 0x31cc4000 + 53818 21 MobileCal 0x00003886 0x1000 + 10374 22 MobileCal 0x000075d8 0x1000 + 26072 23 Foundation 0x31cd861c 0x31cc4000 + 83484 24 CoreFoundation 0x3145711c 0x31430000 + 160028 25 CoreFoundation 0x31456dbc 0x31430000 + 159164 26 CoreFoundation 0x31471446 0x31430000 + 267334 27 EventKit 0x343ac322 0x3438c000 + 131874 28 libSystem.B.dylib 0x3123b678 0x31165000 + 878200 29 libSystem.B.dylib 0x3123be30 0x31165000 + 880176 30 CoreFoundation 0x314582a4 0x31430000 + 164516 31 CoreFoundation 0x31457c80 0x31430000 + 162944 32 CoreFoundation 0x31457b88 0x31430000 + 162696 33 GraphicsServices 0x35d664a4 0x35d62000 + 17572 34 GraphicsServices 0x35d66550 0x35d62000 + 17744 35 UIKit 0x338d5322 0x3389e000 + 226082 36 UIKit 0x338d2e8c 0x3389e000 + 216716 37 MobileCal 0x000029d4 0x1000 + 6612 38 MobileCal 0x00002974 0x1000 + 6516
My Calendar setting for syncing to MobileMe got switched off (this couldn't be user error, as the problem only started when I switched it on.) The bus error got better after I switched the preference on again, but I now have disordered duplicate calendars on the iPhone again.
I got rid of the duplicate Calendars by turning off syncing, choosing Delete, and then enabling it again.
X-APPLE-SORT-ORDER:886040694
.
Some PRODID:-//Apple Inc.//iCal 4.0.2//EN
.
Lots of To Do nastiness, iPhone To Do app?
Some double-diffs, e.g.
CREATED:20100623T194503Z UID:033997B2-8C5A-4616-A8EA-8A0CBB95ACEF X-APPLE-SORT-ORDER:1435901740
Access to account “flashsheridan@me.com” is not permitted. The server responded: “HTTP/1.1 403 Forbidden” to operation CalDAVAddCalendarQueueableOperation.
The calendar https://cal.me.com:8443/principals/users/1.181214238/ was not found on the server. Make sure the URL is correct.