Closed Bug 419601 Opened 12 years ago Closed 12 years ago

Creating new profile fails; error in reading from storage.sdb

Categories

(Calendar :: Internal Components, defect, blocker)

defect
Not set
blocker

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Assigned: mvl)

References

Details

(Keywords: regression)

Attachments

(1 file)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13pre) Gecko/2008022601 Calendar/0.8pre

Steps to Reproduce:
1. Start Sunbird Profile Manager and create new profile
2. Start Sunbird with new profile

Actual Results:
main calendar view and calendar list is empty. Error Console shows:

Error: Error getting calendar schema version! DB Error: no such table: cal_calendar_schema_version
Source File: file:///[...]/sunbird/js/calCalendarManager.js
Line: 484

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///[...]/sunbird/js/calCalendarManager.js :: createStatement :: line 52"  data: no]
Source File: file:///[...]/sunbird/js/calCalendarManager.js
Line: 52

Error: stmt has no properties
Source File: file:///[...]/sunbird/js/calCalendarManager.js
Line: 644

Error: uncaught exception: [Exception... "'[JavaScript Error: "stmt has no properties" {file: "file:///[...]/sunbird/js/calCalendarManager.js" line: 644}]' when calling method: [calICalendarManager::getCalendars]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///[...]/sunbird/components/calCompositeCalendar.js :: anonymous :: line 167"  data: yes]


Regression range: Works in Sunbird 0.8pre (2008022421)
                  Fails in Sunbird 0.8pre (2008022518)

Checkins during regression range: http://tinyurl.com/3xtaef
Flags: blocking-calendar0.8?
Michiel, could this be related to the changed call to initDB() in calCalendarManager.js that was checked in with Bug 413296?
Needs to be fixed.
Flags: blocking-calendar0.8? → blocking-calendar0.8+
This is a fun one.
It indeed seems to be caused by initDB being called too early. I see it getting called twice. I suspect the first one is due to the app being restarted for the extensions manager.
The problem here is that the calendarManager wants to know a db schema version. But that is managed by the storage provider. Without a storage calendar, no schema version. And the creation of that calendar is managed by the UI. Which doesn't exists yet on the first startup...

The best solution would be to create a seperate schema version for the calendar manager (or even a seperate storage file, but that really is out for 0.8)
A workaround can be to create the schema version table from the calendar manager, but that might get messy in the storage provider schema upgrade code.
I vote for the former solution.
The same error occurs if no profile exists and Sunbird is started directly (implicitly creating the default profile).
See bug 377845 on the coupled schemas.
So what is a suitable fix for the 0.8 release timeframe?

Investigate issue further, find solution, e.g. change database schema handling?

Or just backout the changes from Bug 413296?
Blocks: 413296
I'm working on decoupling the schema version from the storage calendar.
Assignee: nobody → mvl
With the patch applied the profile database is created. But after adding one event and restarting Sunbird fails to read the event correctly from database.
Attachment #306061 - Flags: review? → review?(ctalbert)
Status: NEW → ASSIGNED
OS: Windows XP → All
Hardware: PC → All
I retested the patch against a win32 nightly branch build and this time it seems to work. Maybe there is something corrupted with my build system.
Comment on attachment 306061 [details] [diff] [review]
give cal mgr it's own schema version

r=philipp

Looks good to me and works fine on my linux system.
Attachment #306061 - Flags: review?(ctalbert) → review+
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.8
Checked with Sunbird build 20080303 -> task is fixed and verified.
Status: RESOLVED → VERIFIED
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13pre) Gecko/2008030621 Sunbird/0.8

I just saw this bug again but with a slightly different error message:

Error: [Exception... "'cal_calmgr_schema_version SELECT returned no results' when calling method: [nsIObserver::observe]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "<unknown>"  data: no]

Error: uncaught exception: [Exception... "'[JavaScript Error: "stmt has no properties" {file: "file:///E:/sunbird/js/calCalendarManager.js" line: 681}]' when calling method: [calICalendarManager::getCalendars]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///E:/sunbird/components/calCompositeCalendar.js :: anonymous :: line 167"  data: yes]

Could there be some kind of race condition or similar? While I saw this error (reproducible) my system was almost working at 100% capacity due to some unrelated background jobs that slowed down Sunbird.
I don't see that exception on my windows debug build; all works well. Reopening for further investigation.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Does anybody else experience the above exception?
I don't see this error when running on a normal busy system. I only saw the error from Comment #14 sporadically while the system was fully busy. But in this situation it was reproducible.

I would suggest to close this bug and I'll file a new bug if I can reproduce the error situation reliable.
Ok, FIXED again.
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Issue has been reported again, see Bug 428324. I suggest to use Bug 428324 for further investigation on this topic.
You need to log in before you can comment on or make changes to this bug.