[Q] Calendar apps keep crashing, saying "SQLiteException: no such column: setLunar"

Search This thread

PierreTW

Member
Aug 13, 2010
12
8
Taipei
[Q] Calendar apps keep crashing, saying "SQLiteException: no such column: setLunar"

Hi guys!

I recently upgraded my Samsung Galaxy S3 to Jelly Bean 4.1.1.
Now I have the stock ROM, with Auto CF-Root, and Triangle Away, so that Samsung sees it as a genuine Stock ROM.

Since then, I have a problem with Calendar application. The sCloudSync and sPlanner softwares from Samsung kept crashing, so I tried installing Google Calendar, but this one crashes as well!

So I plugged my phone and checked the logs, and here is what I find:

Code:
11-28 17:45:24.330: E/Trace(13008): error opening trace file: No such file or directory (2)
11-28 17:45:24.515: E/SQLiteLog(12003): (1) no such column: setLunar
11-28 17:45:24.520: E/DatabaseUtils(12003): Writing exception to parcel
11-28 17:45:24.520: E/DatabaseUtils(12003): android.database.sqlite.SQLiteException: no such column: setLunar (code 1): , while compiling: SELECT _id, _sync_id, eventStatus, dtstart, dtend, eventTimezone, rrule, rdate, exrule, exdate, duration, allDay, original_sync_id, originalInstanceTime, calendar_id, deleted, facebook_schedule_id, setLunar FROM view_events WHERE (((dtstart <= ? AND (lastDate IS NULL OR lastDate >= ?)) OR (originalInstanceTime IS NOT NULL AND originalInstanceTime <= ? AND originalInstanceTime >= ?)) AND (sync_events != ?) AND (lastSynced = ?))
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1011)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:622)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:400)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:294)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at com.android.providers.calendar.CalendarInstancesHelper.getEntries(CalendarInstancesHelper.java:657)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at com.android.providers.calendar.CalendarInstancesHelper.expandInstanceRangeLocked(CalendarInstancesHelper.java:604)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at com.android.providers.calendar.CalendarProvider2.acquireInstanceRangeLocked(CalendarProvider2.java:1812)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at com.android.providers.calendar.CalendarProvider2.acquireInstanceRange(CalendarProvider2.java:1735)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at com.android.providers.calendar.CalendarProvider2.handleInstanceQuery(CalendarProvider2.java:1488)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at com.android.providers.calendar.CalendarProvider2.query(CalendarProvider2.java:987)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.content.ContentProvider.query(ContentProvider.java:652)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:113)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at android.os.Binder.execTransact(Binder.java:367)
11-28 17:45:24.520: E/DatabaseUtils(12003): 	at dalvik.system.NativeStart.run(Native Method)
11-28 17:45:24.520: E/AndroidRuntime(13008): FATAL EXCEPTION: Thread-566
11-28 17:45:24.520: E/AndroidRuntime(13008): android.database.sqlite.SQLiteException: no such column: setLunar (code 1): , while compiling: SELECT _id, _sync_id, eventStatus, dtstart, dtend, eventTimezone, rrule, rdate, exrule, exdate, duration, allDay, original_sync_id, originalInstanceTime, calendar_id, deleted, facebook_schedule_id, setLunar FROM view_events WHERE (((dtstart <= ? AND (lastDate IS NULL OR lastDate >= ?)) OR (originalInstanceTime IS NOT NULL AND originalInstanceTime <= ? AND originalInstanceTime >= ?)) AND (sync_events != ?) AND (lastSynced = ?))
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:184)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at android.content.ContentResolver.query(ContentResolver.java:372)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at android.content.ContentResolver.query(ContentResolver.java:315)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at com.android.calendar.Event.instancesQuery(Event.java:328)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at com.android.calendar.Event.loadEvents(Event.java:261)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at com.android.calendar.EventLoader$LoadEventsRequest.processRequest(EventLoader.java:144)
11-28 17:45:24.520: E/AndroidRuntime(13008): 	at com.android.calendar.EventLoader$LoaderThread.run(EventLoader.java:201)
11-28 17:45:24.575: E/android.os.Debug(2269): [email protected] > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error


What I understand is there is a missing column in a SQLite Database (android.database.sqlite.SQLiteException: no such column: setLunar), and because of that the application crashes.

Am I the only one experiencing this?

How can I force the re-creation of these Database? Maybe it is using a database with an old format (from my 4.0.4 ICS?)

I tried going in the Application Manager and clearing the data for these applications, and of course I tried de-installing and re-installing Google Clandar, but nothing works...

Thanks in advance for your help!!
 

PierreTW

Member
Aug 13, 2010
12
8
Taipei
I used the following Stock Rom (from SamMobile) which is the ROM from my Taiwanese provider:

KIES_HOME_I9300ZSDLK2_I9300OZSDLK2_500022_REV00_user_low_ship.tar.md5

And after that, I used the followin Auto CF-Root ROM: CF-Auto-Root-m0-gti9300.tar.md5

I tried re-installing both of them by entering in Download mode, plugging the device to the PC via USB, and running Odin's update. Still the same...

If I re-do a clean install of the KIES_HOME_I9300ZSDLK2_I9300OZSDLK2_500022_REV00_user_low_ship.tar.md5 ROM, what should I clean/swipe, and how?

Thanks!
 

PierreTW

Member
Aug 13, 2010
12
8
Taipei
OK, I went into the Recovery mode, did a Factory Reset and cleaned the cache, then restarted, redid the set-up process, and now everything seems ok... I don't know what went wrong, maybe during the initial set-up things went wrong during the Samsung account synchronization...

Thanks!
 

Bitmixer

Member
Sep 2, 2012
19
7
Fix for calendar database errors without factory reset

This error most probably occurs when you upgrade without full wipe or play back a backup of your calendar data after a ROM upgrade. Newer SQlite calendar databases have some new columns which are missing from the old ones.

If you dont want to reinstall from scratch you may take a root terminal and try to do the following:

0) switch off all synchronisation and try to make sure calendar apps and widgets are not running.
1) get a root shell on your device
2) #> cd /data/data/com.android.providers.calendar/databases/
3) #> cp -a calendar.db calendar.db.backup
4) #> echo -n "" >calendar.db
5) #> reboot

This shortens your database to 0 bytes. It should be rebuilt with all proper columns on the next startup. If you get into trouble, you may always put back your backup into place (see step 3). Alternatively you may do a full backup, install a clean ROM with your desired target version from scratch, rip the fresh calendar.db from there, flash back your backup and replace your calendar.db with the fresh version you ripped. Of course, all data in your calendar is lost in both cases. If you had external calendar sync services configured it might be necessary to reconfigure them (delete and recreate their accounts) for their data to resync into your "new" calendar. But the errors should be gone. I presume in many cases this is still far less work than a factory reset and setting up everythig from scratch.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Fix for calendar database errors without factory reset

    This error most probably occurs when you upgrade without full wipe or play back a backup of your calendar data after a ROM upgrade. Newer SQlite calendar databases have some new columns which are missing from the old ones.

    If you dont want to reinstall from scratch you may take a root terminal and try to do the following:

    0) switch off all synchronisation and try to make sure calendar apps and widgets are not running.
    1) get a root shell on your device
    2) #> cd /data/data/com.android.providers.calendar/databases/
    3) #> cp -a calendar.db calendar.db.backup
    4) #> echo -n "" >calendar.db
    5) #> reboot

    This shortens your database to 0 bytes. It should be rebuilt with all proper columns on the next startup. If you get into trouble, you may always put back your backup into place (see step 3). Alternatively you may do a full backup, install a clean ROM with your desired target version from scratch, rip the fresh calendar.db from there, flash back your backup and replace your calendar.db with the fresh version you ripped. Of course, all data in your calendar is lost in both cases. If you had external calendar sync services configured it might be necessary to reconfigure them (delete and recreate their accounts) for their data to resync into your "new" calendar. But the errors should be gone. I presume in many cases this is still far less work than a factory reset and setting up everythig from scratch.