Closed Bug 428324 Opened 12 years ago Closed 12 years ago

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

Categories

(Calendar :: Internal Components, defect, major)

x86
All
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: msnipana, Assigned: dbo)

References

Details

Attachments

(9 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13pre) Gecko/20080331 Sunbird/0.8

May be there is problem with profile creation by installation procedure. 

Reproducible: Always

Steps to Reproduce:
1. I installed clean Windows XP and drivers. Logged in with admin rights.
2. Download sunbird-0.8.en-US.win32.installer.exe, install and start Sunbird

Actual Results:  
3. Select menu <File>-<new task> but nothing happens.
4. Enter some text in "Click here to add a new task" but nothing happens.
5. Select menu <File>-<open calendar file>, select file and press open but nothing happens.
6. Switch to calendars pane - there is no one calendar

Expected Results:  
3. The new task window should appear
4. The new task window should appear
5. New calendar should added
6. There have to be at least one calendar

Error: Error getting calendar schema version! DB Error: no such table: cal_calendar_schema_version
Source File: file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js
Line: 521

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

Error: ics-service doesn't recognize own tzid: /mozilla.org/20071231_1/Asia/Jerusalem
TypeError: autumnShiftJSDate has no properties
Source File: chrome://calendar/content/calUtils.js
Line: 689

Error: stmt has no properties
Source File: file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js
Line: 681

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

Error: aCalendar has no properties
Source File: chrome://calendar/content/calUtils.js
Line: 791

Error: this.treebox has no properties
Source File: chrome://calendar/content/calendar-management.js
Line: 315

Error: uncaught exception: [Exception... "'[JavaScript Error: "this.mCalendar has no properties" {file: "file:///C:/Program%20Files/Mozilla%20Sunbird/js/calTransactionManager.js" line: 167}]' when calling method: [nsITransaction::doTransaction]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///C:/Program%20Files/Mozilla%20Sunbird/js/calTransactionManager.js :: cTM_createAndCommitTxn :: line 68"  data: yes]

Error: uncaught exception: [Exception... "'[JavaScript Error: "this.mRegisterCalendar has no properties" {file: "file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js" line: 577}]' when calling method: [calICalendarManager::registerCalendar]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://calendar/content/calendar-creation.js :: openLocalCalendar :: line 63"  data: yes]


----------------------------------------------------



To get ride off problem:
1. deinstall Sunbird ver 0.8, delete  "C:\Documents and Settings\host\Application Data\Mozilla\Sunbird" directory 
2. install Sunbird ver 0.7 - all works Ok in ver 0.7. 
3. deinstall Sunbird ver 0.7 but NOT delete "C:\Documents and Settings\host\Application Data\Mozilla\Sunbird" directory
4. then install Sunbird ver 0.8 again - all works OK.
Reporter, what system do you use? Is it possible that you use a rather old system with only little memory?
Confirming bug.

This matches the issue I experienced once, see Bug 419601 Comment #14. I saw  this when my system was working at 100% CPU and RAM capacity and I tried to create a new profile.

The issue has been reported too in mozilla.dev.apps.calendar by Michael Wolf <http://groups.google.com/group/mozilla.dev.apps.calendar/browse_thread/thread/a6396170afe4d2d4#> for Linux and Windows. He's using a 1100 Mhz Celeron with 126 MB RAM only.
Status: UNCONFIRMED → NEW
Component: Sunbird Only → Internal Components
Ever confirmed: true
OS: Windows XP → All
QA Contact: sunbird → base
Summary: Can't create new task and new event. There is no any calendars. → Creating new profile fails on some systems; error in reading from storage.sdb
Reporter, after second installation of SB 0.8., did you try to create a new profile or did you use the default profile? I stated that the issue occurs only when I want to create a new profile. Once I'm using the default profile it works all fine.
The system is quite modern: CPU mobile Athlon XP 2000+, ROM 512MB, on HDD 12G free space, Windows XP prof service pack 2, CPU load was 0%.

After second installation of SB v0.8 I used profile from previous installation of SB v0.7. I try it with profile from SB v0.5 - all works fine.

It seems that problem is with creation of profile by SB v0.8 installation.
If it is possible, send to me modified installation pack with full loggining on. I will install it on my system and report the full log. 
Duplicate of this bug: 430490
From Bug 430490 - I had this problem in Vista 64-bit SP1 but not in XP Pro SP2 (virtualized from Vista in Virtual PC 2007, 256MB RAM provided) so I assumed it was a Vista-related issue.  For now, I will just use Lightning, and test SB 0.7 as well.
Flags: wanted-calendar0.9?
I've just downloaded SB 0.9pre. The issue still exists. But I changed then the line 357 in /js/calCalendarManager.js from "var checkSchema = true;" to "var checkSchema = false;"
Now the issue doesn't appear more.
Flags: wanted-calendar0.9? → wanted-calendar0.9-
In the last days I have seen some reports about this kind of issue when installing Sunbird 0.8 on Windows Vista. It only worked when creating the profile in a different custom location. Could someone test if Sunbirds installer and profile creation works reliable on Vista?
Keywords: qawanted
Stefan,

My initial problem in Bug 430490 was in Vista Home Premium 64-bit SP1, installing Sunbird 0.8.  I had this profile issue there.  PC specs - new HP laptop, AMD 64-bit dual core processor @ 2.1GHz, 4GB RAM.

I haven't tried 0.9pre.  Lightning 0.8 works perfectly on both this machine and on a PortableApps installation of Thunderbird.
http://forums.mozillazine.org/viewtopic.php?t=658791
Could it be mcafee which is causing this, which virusscanners do you have installed?
I have no virus scanners installed.  I occasionally run an online scan via Symantec.  There was a trial version of Norton installed from the OEM, but I removed it several weeks before attempting to install Sunbird.  The only other software I have in that category is Windows Defender.

According to that thread, it looks like it's an issue with how 0.8 installs as opposed to 0.7, and leaving the folder (or some files) behind is the fix for installing 0.8 correctly.  I decided to use Lightning instead, and did not try the workaround. 

I would say that perhaps it is a problem with 64-bit Vista, but the originator of this bug was using Windows XP SP2, a system on which I had no problems.
Duplicate of this bug: 432789
Flags: blocking-calendar0.9?
From the old bug ( 432789 ), I am having problems with Lightning + Thunderbird on Windows Vista 64 Premium, 4 GB RAM, 2.6GHz dual core processor laptop.

The screenshots that display the error:

http://www.burhankhalid.com/images/error.png

Thunderbird and Lighting versions are latest that are available from the official website (no -pre builds) and are verified upto date by the built-in update checks.

I will now try this on Ubuntu 32 bit on the same machine and report back.
I have this problem also on vista home premium, on a centrino duo 1.66 with 1gb ram. I see that people are talking about changing to a default profile so I have two questions
1. How do I select the default profile
2. if it's a "default", why do I have to select it at all?
As Michael Wolf mentioned above, this issue can be suppressed by modifying the checkSchema = true; (to false) in /js/calCalendarManager.js. With the value set to false, Sunbird will open up and display the default calendar. If the value is returned to true, the issue reappears. (XP SP2, 1GB)

Can someone contact me off-bugzilla with tips on how to interact with the javascript environment within Calendar / Sunbird. Also I may benefit from a pointer to how to query the internal database that is used. 

I would like to correct this bug. I have also confirmed this to exist in the nightly build of (sunbird-0.6a1) on 20080603.

Thank you. I am just getting started with open source contribution.
Duplicate of this bug: 438791
The same on Windows 2000 Prof. with SP4, 1GB RAM, Celeron 2.4 GHz, 20 GB free disk space.
Sunbird version 0.8 fresh install.

Modifying the checkSchema = true; (to false) in /js/calCalendarManager.js. helps.
Flags: wanted-calendar0.9-
Flags: blocking-calendar0.9?
Flags: blocking-calendar0.9+
Having issues.  Running Vista 32 bit Business edition.  I don't think this is related to the profiles at all since it is referencing the java script files in the home program directory.  Could this be a compilation issue in Vista?  I have the most recent Java package (ver. 6) installed.  

Error: Error getting calendar schema version! DB Error: no such table: cal_calendar_schema_version
Source File: file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js
Line: 521

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

Error: stmt has no properties
Source File: file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js
Line: 681

Error: stmt has no properties
Source File: file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js
Line: 681

Error: uncaught exception: [Exception... "'[JavaScript Error: "stmt has no properties" {file: "file:///C:/Program%20Files/Mozilla%20Sunbird/js/calCalendarManager.js" line: 681}]' when calling method: [calICalendarManager::getCalendars]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///C:/Program%20Files/Mozilla%20Sunbird/components/calCompositeCalendar.js :: anonymous :: line 167"  data: yes]
Just tried this workaround and it appears to have worked.  Not sure the entire reasoning and would also be anxious for this bug to be fixed.  Thanks for the fix!

(In reply to comment #16)
> As Michael Wolf mentioned above, this issue can be suppressed by modifying the
> checkSchema = true; (to false) in /js/calCalendarManager.js. With the value set
> to false, Sunbird will open up and display the default calendar. If the value
> is returned to true, the issue reappears. (XP SP2, 1GB)
> Can someone contact me off-bugzilla with tips on how to interact with the
> javascript environment within Calendar / Sunbird. Also I may benefit from a
> pointer to how to query the internal database that is used. 
> I would like to correct this bug. I have also confirmed this to exist in the
> nightly build of (sunbird-0.6a1) on 20080603.
> Thank you. I am just getting started with open source contribution.

What seems odd to me is that just ommitting the check for the calendar-scheme works. This means the scheme is in place but it just can't be read? Could someone who experiences this post the data and struture of the table in storage.sdb (viewable with https://addons.mozilla.org/en-US/firefox/addon/5817)
Or maybe attach the storage.sdb file from a new profile that shows the error.
This document contains lists of SQLite tables created through the point where the calendar creation fails using various Sunbird versions. See Also: the .sdb files saved at the point where the program failed. SQLite sdb files appear to be created as needed as the program is launched.

For each case, all prior Profiles were removed from the system.
Attached file SQLite data for 0.8rc1
Attached file SQLite data for 0.8rc2
There's a huge difference between the tables in 0.8rc1 (which seems correct, at least it has cal_calendar_schema_version among others) and 0.8rc2/0.8 (which only have the tables cal_calendars and cal_calendars_prefs. When I install Lightning 0.8 it has 9 tables instead of the two you have. cal_calendar_schema_version only holds an integer.
ok, so wild guessing which might be the completely wrong direction:
http://bonsai.mozilla.org/rview.cgi?dir=mozilla/calendar/providers/storage&cvsroot=/cvsroot&module=default
contains only schemes uptill version 7 which might lead to problems I guess as storage.sdb in a new profile has cal_calendar_schema_version = 8 and cal_calmgr_schema_version = 9. Don't know the inner workings enough to be able to say if this is the problem though.
Those schema files are only for reference. They are not used.
I think there is some race condition somewhere, because it only seems to show on some systems.
I wonder if the creation of tables and other DB initialization should be done in transactions, using one of the appropiate flags?
http://mxr.mozilla.org/seamonkey/source/storage/public/mozIStorageConnection.idl#159
Assignee: nobody → daniel.boelzle
Duplicate of this bug: 445969
I've not been able to reproduce the problem on a local Vista system. Andreas has had the same problem some time ago on that system, but I could not reproduce it any longer (as well as Andreas). However, I've had a look at the failing profile (which still fails), because the initial tables of calCalendarManager failed to be created properly: The storage.sdb just has cal_calendars and cal_calendars_prefs, not cal_calmgr_schema_version. Since there's only an initial check whether cal_calendars exists (if not, then all 3 tables are created and the schema version is set), the known error messages appear.
Although Andreas' storage.sdb looks a bit different than Brian's, IMO they are quite similar: Brian's has all 3 tables created, but the schema version INSERT command seems to have failed.
I suspect the problem is indeed a race, e.g. a context switch while creating the tables. We should try to put those into a lock as mvl suggested in comment #30; the EXCLUSIVE lock looks like the right thing, because it puts a read lock on the database.
Brian (or someone else who can reliably reproduce the problem): Would you please try out the patch?
I've tested this patch of /js/calCalendarManager.js.
The build I started with was obtained today from http://ftp.mozilla.org/pub/mozilla.org/calendar/sunbird/nightly/latest-mozilla1.8/sunbird-0.9pre.en-US.win32.zip.

No errors were encountered during initialization with this patch applied. It appears all proceeded as it should.

For comparison, I re-ran this nightly build of Sunbird without the patch. I did encounter the issue as before.

Attached are the storage.sdb files from both runs.
I just tried this patch with 0.9pre and 0.6a1 (tinderbox) build.
This patch works fine for 0.9pre but does not help for 0.6a1. On the other hand after updating storage.sdb with 0.9pre I can use this modified storage.sdb afterwards with 0.6a1 without problems.
Sorry. I have to correct me. I just realized that I never tried to use 0.9pre in this way. For the conversion of storage.sdb via 0.9pre this patch is not necessary. After having used storage.sdb with 0.9pre I can use with 0.6a1 without applying this patch to 0.6a1.
(In reply to comment #37)
Different issue. Database updates in Trunk builds are failing due to Bug 429521.
Comment on attachment 330272 [details] [diff] [review]
put into transaction

Requesting review from mvl.
Attachment #330272 - Flags: review?(mvl)
Status: NEW → ASSIGNED
Comment on attachment 330272 [details] [diff] [review]
put into transaction

I can't test if this fixes the bug, but the change looks correct. The creation of the tables and the storage of the version number should clearly be one atomic operation.

(Thinking of it, I don't really know where a race condition could happen, because all calendar code is single-threaded)
Attachment #330272 - Flags: review?(mvl) → review+
(In reply to comment #41)
> (Thinking of it, I don't really know where a race condition could happen,
> because all calendar code is single-threaded)
Doesn't that only mean that only a single thread is executing a script at a time, although it might happen that a blocked operation causes another thread to come into play? I have no other explanation for what I've seen.

Checked in on HEAD and MOZILLA_1_8_BRANCH => FIXED.

I hope this fixes the bug, please reopen if not.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: qawanted
Resolution: --- → FIXED
Target Milestone: --- → 0.9
Duplicate of this bug: 450008
Duplicate of this bug: 428454
I am a server administrator.  My server is a Windows 2003 R2 version.  Terminal services are implemented.  My user all work with thin clients.  My server has plenty of memory, disk space and CPU availability.

We wanted to switch to the Mozilla suite.  Other softwares worked fine (Thunderbird and Firefox), but Sunbird 0.9 was not working.  I had the error mentionned in this bug.  

This fix worked fine : change the line 357 in /js/calCalendarManager.js from "var checkSchema = true;" to "varcheckSchema = false;"

With my server, I often experience this kind of problem with new softwares.  The reason is my users have VERY limited rights.  They don't even see the existence of C:\.  So I guess the NTFS rights limitations where part of the problem.  Probably Sunbird was trying to access a directory that my users where disallowed to browse the content (very probable because I installed Sunbird on the C:).
You need to log in before you can comment on or make changes to this bug.