Getting a Database Error in your Nightly?

This post is directed towards those of you who are regularly using nightly builds.

Due to some problems in the upgrader code for the local storage calendar, some of you might be getting an error like:

Error updating timezones: Error: mozIStorageStatement::step() returned
an error
DB Error no such column: recurrence_id_tz

To be more specific, this should affect all nightly users that have used a build after 2009-11-07. Fortunately, we have fixed this issue in bug 529853, but this won’t save nightly users that already have a broken profile. Luckily, its quite easy to fix the problem manually.

I have created an extension that can be used detect if your profile is broken and also to repair it. For more information, please see bug 529853.

Update:The first version of the extension didn’t properly update the cached calendar. If you are still experiencing problems, try the new version, I’ve updated the above link


  1. I never had the problem, yet I just installed the extension (Fix Storage Schema v17 0.2) “just in case”, because I’ve been using Sunbird nightlies since before branch nightlies stopped being built off Gecko 1.8.1, and a few days ago I created a new calendar.
    The extension gave no message (it said neither that my schema is OK, nor that it was broken and will be repaired). I don’t see any “diagnose” or “repair” menu item.
    Together with installing the extension I upgraded Sunbird to:
    User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20091125 Calendar/1.0pre
    Build ID: 20091125054255
    Additional info: All my calendars (2 remote and 5 local) are *.ics files not located in my profile.
    In the Error Console I see a number of messages which seem unrelated with this extension, and the following, which might or might not be:
    Error: [Exception… “Component returned failure code: 0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED) [nsIDocShellHistory.useGlobalHistory]” nsresult: “0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)” location: “JS frame :: chrome://global/content/bindings/browser.xml :: :: line 643” data: no]
    Source File: chrome://global/content/bindings/browser.xml
    Line: 647

  2. Thank you for your job !
    Big Up from France !!!

  3. Tony, you should be getting a Dialog on each startup that tells you if your Profile is broken or not broken? The error console message looks like a common one, but not related to the storage schema. If you have no other error console messages, then you are fine.
    I’m going to be updating this extension soon to fix all sorts of errors where the storage schema is incomplete, so in case you have any errors in the future about missing columns, stay tuned.

  4. I have a broken profile and could not repair it with this patch. When I open TB I get 4 pop-ups:
    – 2x Calendar Error (for my 2 Local Cals)
    – Master Password
    – Fix Storage
    The Fix Storage Pop-up tells me that my profile is broken. When I click “Fix” (once or repeatedly) nothing happens. So, I click continue and restart TB. Same as above.
    Any help?

  5. Fabian,
    what error console messages are you getting? Please send me those in addition to your local.sqlite and cache.sqlite which can be found in the calendar-data folder in your profile via email. My email can be found in the above mentioned bug.

  6. @Fallen: Well, I’m not getting any such dialog. I’ll be assuming my schema is OK. Should I disable/uninstall the extension or keep it in? (Edit: I notice it has disabled itself on the next day, so maybe this answers my question.)
    FWIW, I’m running Sunbird with the following extensions installed:
    1) DOM Inspector 2.0.4
    2) Fix Storage Schema v17 0.2
    3) MR Tech Toolkit
    4) Provider for Google Calendar 0.6pre
    5) Timezone Definitions for Mozilla Calendar 1.2009p
    (1) and (3) from AMO, (2) is yours, (4) from the same FTP directory as the Lightning build corresponding to my Sunbird build, (5) is part of the Sunbird installation.
    Note: The latest Sunbird comm-1.9.1 nightly suddenly calls itself “1.0b1pre” rather than “1.0pre” (a “downgrade” ???). This means that extensions.checkCompatibility needs to be false if I want to keep the extensions (such as DOMi) which have minVersion set to 1.0pre:
    User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20091126 Calendar/1.0b1pre
    Build ID: 20091126031111

  7. I just installed Fix Storage Schema v17 0.2. It’s disabled and tells me it requires additional add-ons, but not which ones. My local calendars are still broken.
    My Tb version:
    Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20091121 Lightning/1.0b1pre Thunderbird/3.0
    Is there a way to fix local calendars manually with SQLite Manager?

  8. Never mind, I figured it out from the extension source. Just add these columns:
    * recurrence_id INTEGER
    * recurrence_id_tz TEXT
    to these tables:
    * cal_alarms (already had the columns in my calendar)
    * cal_attachments
    * cal_relations
    in these databases:
    * calendar-data/local.sqlite
    * calendar-data/cache.sqlite (if exists)
    in the profile folder and Lightning is happy again.

  9. I still have my profile broken and can’t fix it with the extension. I get no error, but lots of warning messages which look like:
    Warning: Could not add recurrence_id_tz, may already exist(cal_relations: [Exception… “Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.executeSimpleSQL]” nsresult: “0x80004005 (NS_ERROR_FAILURE)” location: “JS frame :: chrome://fix-storage-v17/content/fix-v17.js :: fix :: line 106” data: no], db error:duplicate column name: recurrence_id_tz
    What should I do?

  10. @orange:
    had the same here (cal_alarms already containing the columns) and the fix worked.
    thanks a lot the fix plugin told me there were things missing but now what (like in a previous post)

  11. Now it tells me it requires additional items, so i checked the items mentioned above, but i had them all. so the fix doesn’t work, my storage is still broken and my thunderbird looks quite ugly without tasks…
    any help? thx!

  12. Sayre Swarztrauber

    Thank you to Orange. I had the same problem with TB3 on x86_64. My calendar disappeared and only the .ics data that I originally populated into Lightning was there. I had exactly the same symptoms as orange. I added the two columns only to cal_attachments and to cal_relations but I also had to delete storage.sdb from my profile. At that point my calendar was working. I don’t know if this mattered, but I also installed “Fix Storage Schema v17 0.2 (fixes bug 529853). It found and fixed a broken profile, but did not fix my Lightning problem. I needed to follow the steps (using Firefox sqlite manager) to add the two columns to the two tables to retrieve all of my data.

  13. Thanks a lot, my task list was lost now it’s back! Thanks!!!

  14. [Exception… “Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.executeSimpleSQL]” nsresult: “0x80004005 (NS_ERROR_FAILURE)” location: “JS frame :: file:///C:/Documents%20and%20Settings/phil/Application%20Data/Thunderbird/Profiles/1mrmhc28.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/modules/calUtils.jsm -> file:///C:/Documents%20and%20Settings/phil/Application%20Data/Thunderbird/Profiles/1mrmhc28.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calStorageCalendar.js :: anonymous :: line 220” data: no]

  15. using the german Version of Calendar.
    After migrating from a Vista to Win 7 System, I re-installed the Thunderbird + Lightning, I get the following message:
    “Beim Bereitstellen des Kalenders mit der Adresse moz-profile-calendar:// ist ein Fehler aufgetreten. Er wird nicht verfügbar sein.”
    (When preparing calendar with the address moz-profile-calendar:// an error occured. It won’t be available”.
    Error-Code: 0x80004005
    Additonal description:
    [Exception… “Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.executeSimpleSQL]” nsresult: “0x80004005 (NS_ERROR_FAILURE)” location: “JS frame :: file:///C:/Users/stefan/AppData/Roaming/Thunderbird/Profiles/4yrqbqiz.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/modules/calUtils.jsm -> file:///C:/Users/stefan
    I had Lightning 0.9 with ThunderBithDay 0.2.9 as Extensions of Thunderbird on he old computer, now it’s Thunderbird 3.0.3 w/ Lightning 1.0b1 and ThunerBirthDay 0.3.3.
    I saved the data using MozBackup 1.4.10-EN and restored it on the new computer w/ the same program. It seemed everythin was working fine, until I restarted Thunderbird and it updated some extensions (sorry, I didn’t really write down which ones, but I think it was Lightning).
    Now I cannot open any of the calendars, nor open new appointments nor do anything w/ the calendar.
    Thank you in advance for your help!