How To Stop CalendarAgent From Eating CPU

Recently ran into an issue with Calendar causing a huge CPU spike. Checking the system.log I noticed the following repeatedly in my log:

CalendarAgent[379] Unexpected EOF, returning last token as fallback

CalendarAgent is essentially Calendar’s backend (that’s how it’s also able to power the notification center). The best resolution I’ve found is to completely clear out the calendar and recreate it. Process I used was as follows:

  1. Remove the Calendar from “Mail, Contacts & Calendars” pref panel (just uncheck from the account). Then go into Calendar and make sure the account is removed. If it’s not, remove it.
  2. Delete ~/Library/Calendars/
  3. Delete ~/Library/Preferences/com.apple.iCal.plist
  4. Go back into the “Mail, Contacts & Calendars” pref panel, put the calendar back. Give it some time to download.

That seems to have worked for me.

Z2k9 Bug Strikes The Zune

From the company that brought you Windows ME, and Windows Vista, Microsoft Corporation today introduced the world to the Z2K9 bug. Apparently all 30GB Zune’s reboot and freeze due to a bug in the date/time drivers. Classic. Microsoft’s solution is to simply wait until 2009 (a few more hours). Even more classic.

This does bring up one of every programmer’s biggest pet peeves: date/time code. I’ve mentioned my hatred of time before. It’s one of the most obnoxiously complicated things to work with due to all of the complexities from leap seconds to leap years. If you need to do something involving old dates, it gets even more complicated. Remember Julian Thursday, 4 October 1582 was followed by Gregorian Friday, 15 October 1582. Yes you read that right. Also don’t forget that only certain countries (mostly those under strict influence of the Pope) switched on that date. There was dual dating for some time. Then you have timezones, which ideally would be geographically correct and 15° of longitude apart, but instead zigzag and not even along territorial borders. Worst of all is daylight savings time. Not everyone participates in that, and sometimes just not every year, or at the same time. Even states are split, just check out the chaos in Indiana.

Griping aside, none of these likely caused the Zune bug. Since it’s a freeze, I’d guess it’s nothing more than an infinite loop or some other trivial programming error on a leap year.

Everyone remembers the infamous Y2K bug. Many uneducated folks still claim it was nothing to worry about and overblown, but it still cost between $300-600 billion dollars depending on whose estimates you believe (3.596 billion from the US military alone). Since a large portion of the cost was in the private sector, there’s no true tally.

The next big day to keep in mind is January 19 2038 3:14:07 GMT. That’s when the 32 bit computing will officially freak out since most Unix-like computers store time as a signed 32 bit integer counting the seconds since Jan 1, 1970 (Unix Epoch). After that we go back to 1901. There will likely be some 32 bit computing left in 2038 considering how long embedded systems can be ignored and silently slaving away in the background. For reference the B-52 Stratofortress entered operation in 1955 (they were built until 1962). They are expected to be taken out of service in 2040. This is the exception for US military aircraft, but don’t think this is the only old hardware out there. The Hubble Space Telescope has a 32 bit 486 processor and launched in 1990 and assuming the backup computer is functional it will be serviced soon to extend it’s life by another few years making it’s service life 20+ years. It’s unlikely Hubble will make it to 2038 but Hubble shows how long expensive systems can survive in active use. This date is only 30 years away. This will cost the world some serious cash.

On the upside according to Wikipedia 64 bit systems will be good until Sunday, December 4, 292,277,026,596. Odds are that won’t be a concern for most people alive today.

Reassuring? Yes. But your Zune is still fried for a few more hours.

Update [1/5/2009]: Here’s some pretty detailed confirmation that it was indeed an infinite loop error. I know my crashes 😉 .

Gmail Contact Sync

Google released the API for contacts. How long before someone comes up with a Thunderbird plugin to sync up with it? Any takers?

I’d love to know why they decided the API route, rather than use LDAP. It can be secured using TLS, and require a bind DN and bind password. If they did it that way, most email clients would be compatible right out of the gate.

There’s also Google Calendar Sync, but only supports Outlook. Still no CalDAV.

I’m slightly disappointed, but at least with an API thinks are workable. Standards would still be best.

Mozilla Messaging

As some may remember, Mozilla’s plan for Thunderbird was to form a new (then unnamed) company owned by the Foundation. Mozilla Messaging has now launched. I’m a fan of this approach as I think it allows for the most synergy between the projects, which are really more fraternal or conjoined twins than sister projects. It also allows for more dedicated resources and focus that Thunderbird wasn’t receiving before.

David Ascher has a great post on what’s to come. There are a few things I’d like to touch on though.

…Specifically, Thunderbird 3 will build on the great base that is Thunderbird 2 (and the work already performed in trunk by the current and past contributors), and add some key features, such as:

Presumably meaning it’s based on Mozilla 1.9, though I’m not 100% clear on this.

  • Integrated calendaring (building on the great work done by the Mozilla Calendar team and their Lightning add-on to Thunderbird),

Awesome. This is something that was missing from long ago. Though I wonder how far it will go without the server side being as available, robust and tested. Exchange compatibility would bring about the most corporate adoption, though that could be difficult to engineer. Google Calendar is supported via an addon. It’s still lacking in a few places, though rapidly improving. I believe it also works with Zimbra (can anyone confirm?), which is a good start.

  • better search facilities,

I’m curious what this entails. Search is always tricky. Google Desktop has proven a good solution for many who need better search with their email client.

  • easier configuration,

Cool. Enough said. I’ve had thoughts on that for a while.

  • and a set of other user interface improvements.

Hopefully this will result in some native skinning similar to what Firefox 3.0 is doing.

Address Book is also about 4 years overdue for an overhaul. Personally I think it should be replaced entirely and use a mozStorage backend. Perhaps even look at the possibility of some data sharing with services like Facebook, Plaxo and LinkedIn. Obviously being careful to avoid causing a Scoble by scraping data. For something like this data portability will be critical.

Personally I’d like to see some standard emerge where closed messaging services can essentially be interfaced like an IMAP account. So one could plug in their account info and interact with their account via any tool they choose. Obviously sending would be limited to within the provider’s walls. Contacts, data, etc. can be sync’d between both providing a seamless experience.

…Another strength is that we already have a complete web technology stack built into our mail client, and as a result, we can consider deep integration with both websites and web services which other solutions can only dream of.

Extensions are powerful. But this is really where the strength is. It’s a rather complete platform, and constantly expanding to keep up with the latest. It’s far from a hacked together parser that does a subset of html.

I suspect 3.0 will be somewhat of a quieter release. Change won’t come overnight. Those expecting a radical new approach to email by 3.0 will likely be disappointed. 4.0 is where things will become a more disruptive. I’d assume this will correspond with Mozilla2, which might work out to be an advantage.

As a final note, for any who don’t realize Scott MacGregor and David Bienvenu (no idea where his new blog will be) aren’t working for Mozilla Messaging but will still be involved with Thunderbird. They haven’t said too much on their plans yet.

That’s about all of my thoughts on the topic for now.

Thunderbird is dead, long live Thunderbird.
Email is dead, long live Email.

mozPod 0.2a1

mozPod 0.2a1 is available. It’s alpha because it hasn’t been as well tested as of yet. I wanted to get it out before Thunderbird 2.0 ships, and I’ve been getting a fair number of requests for it lately.

I’ve released MozPod 0.2a1 as an interim release for Thunderbird 2.0 users who want to use mozPod and see some new features. I decided to not support mozPod 0.1 on Thunderbird 2.0 to keep things easier to manage.

This is an alpha release and likely has some bugs. I wanted to get it out for those who want to start testing. This would be an ideal time as people want to move to Thunderbird 2.0.

Here’s the changes that matter:

  • Feature – Preliminary support for Lightning (if installed).
  • Enhancement – Thunderbird 2.0 support.
  • Enhancement – Some performance tweaks.
  • Fix – Sync all available AB’s.
  • Fix – Correctly handle notes that are more than one line.
  • Fix – Skip over LDAP servers in Address Book without failing.
  • Fix – Try to not hold lock on disks.

As usual, if you like it and want to encourage me to spend a little more time on it, feel free to do so. I do request some feedback. Let me know how it works for you.

I’ve got more extension goodness on the way. I’m planning to get to a real mozPod 0.2 release in the next few weeks. There may be a new extension on the way as well…

You download it from this link: mozPod 0.2

Open Source Corporate Email

According to ZDNet a Yankee Group report to be released next month found that of 1,000 IT managers and C-level executives, “23% of the survey respondents indicated they intend to migrate away from Exchange Server.” That’s a rather impressive number. Quite a few of those could go to Zimbra or Hula/NetMail, which could make great companions for Thunderbird, who buy the way is rapidly developing a calendar, which is starting to look pretty good.

It could be interesting to see what happens.

When Will Google Calendar Become Usable?

Google Calendar is an awesome web application. And despite my best efforts, Google doesn’t want me to use it. It came out back in April, and still lacks WebDAV support. As a result it’s read-only for client side applications. If they supported WebDAV so we could have full access to calendars, it would be infinitely more usable. I just don’t understand how it launched without. Who knows, perhaps one day it will catch up.

Ideally it would come out with Sync conduits for popular platforms: WebDAV (covers iCal and Sunbird), HotSync (Palm) and Blackberry.

Until then I still can’t figure out how I’d use it on a daily basis. It’s a shame, it’s an awesome app, but unfortunately it’s shortcomings are fatal.

Lightning Strikes The iPod

I started working to implement support for Lighting (project to integrate Calendar into Thunderbird) to sync with Apple iPods via mozPod. Didn’t take to long before I had a successful sync. It’s not done yet, and likely some big evil bugs (read: including but not limited to loss of data or first born child), but it’s well on the way!

That’s right, we now have the ability to sync contacts and calendar to the iPod on Mac/Windows (Linux still on the todo list, though it’s mostly there). It will require Thunderbird 1.5 or later. No release date just yet.

How cool is that? 😀

mozPod 0.2 Status

I have slowly been working on a new mozPod release, it’s just not going very fast, as it’s still a lower priority project. So far, it seems to be pretty well accepted. Here are a few of the changes planned, or already completed:

  • Preliminary Lightning Support
  • Having an LDAP server setup in your Address Book won’t cause the sync to fail
  • Some code cleanup, optimization, and bug fixes

For the record, I will be dropping support for Thunderbird 1.0.x in mozPod 0.2. Most people seem to be upgrading, and it’s just not worth the hassle. Many (or most) seem to have had problems with MozPod and Thunderbird 1.0 anyway.

Yes, development is a little slow, but it’s free (unless you feel like saying thanks), so don’t complain ;-).

Update: It’s out.

My PDA Doesn’t Stay Up Past Midnight

Recently my Sony Clie has been giving me the following error when I try to HotSync:

— Date Book
– Your device does not support events spanning midnight. The end time
was set to 11:55 on both the Palm Desktop and the device for this event:
[event description

I finally found the problem.

You need to right click on the HotSync icon in the system tray (or open the HotSync Application) and go to “Custom…”. Then find “Datebook”, and set it to “Do Nothing” and check to make it default. Then make sure “Calendar” is set to Sync. Press “OK”, then do your sync.

That fixes one of the most annoying problems I’ve seen in a long time. Apparently there are two versions of the Palm Desktop Calendar HotSync API’s, each with their own conduit. Even if your event goes from 9:25 AM – 10:30 AM, you can get this annoying error if your using the wrong conduit. By making this change, your computer and PDA can communicate in the same language.

Perhaps someone else will be able to make use of this little tip I figured out. As for me, it might be about time to start thinking of a replacement for this PDA.