Closed Bug 520139 Opened 15 years ago Closed 14 years ago

Gloda does not protect against exceptions thrown by openUnsharedDatabase on corrupt databases

Categories

(MailNews Core :: Database, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: daniele, Assigned: asuth)

References

Details

(Whiteboard: [gloda key])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090804 Remi/fc10 Firefox/3.5.2 FirePHP/0.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20091001 Shredder/3.0pre

The gloda search does not display anything.

I'm using a profile imported from the latest 2.0.0.23

I installed the beta4, got this error and then tried with the latest nigtly; the error is the same in both versions.

Using a new profile the error does not appear, so it's probably something broken in my profile.

When I launch thunderbird I get this error in my console (I have the logging enabled)


2009-10-02 12:34:52	gloda.NS	INFO	Logging Initialized
2009-10-02 12:34:52	gloda.datastore	DEBUG	Beginning datastore initialization.
2009-10-02 12:34:52	gloda.NS	DEBUG	Exception during Gloda init (undefined:741): [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageService.openUnsharedDatabase]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///opt/homes/daniele/thunderbird/modules/gloda/datastore.js :: gloda_ds_init :: line 741"  data: no]
2009-10-02 12:34:52	gloda.indexer	INFO	Event-Driven Indexing is now true
2009-10-02 12:34:52	gloda.everybody	INFO	... loading resource://app/modules/gloda/fundattr.js
2009-10-02 12:34:52	gloda.NS	INFO	Defining noun: mime-type
2009-10-02 12:34:52	gloda.everybody	ERROR	!!! error loading resource://app/modules/gloda/fundattr.js
2009-10-02 12:34:52	gloda.everybody	ERROR	(undefined:53) [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: file:///opt/homes/daniele/thunderbird/modules/gloda/everybody.js :: loadModule :: line 53"  data: no]
2009-10-02 12:34:52	gloda.everybody	INFO	... loading resource://app/modules/gloda/explattr.js
2009-10-02 12:34:52	gloda.NS	INFO	Defining noun: tag
2009-10-02 12:34:52	gloda.everybody	INFO	+++ loaded resource://app/modules/gloda/explattr.js
2009-10-02 12:34:52	gloda.explattr	ERROR	Error in init: TypeError: this.asyncConnection is null
2009-10-02 12:34:52	gloda.everybody	ERROR	!!! error initializing resource://app/modules/gloda/explattr.js
2009-10-02 12:34:52	gloda.everybody	ERROR	(file:///opt/homes/daniele/thunderbird/modules/gloda/datastore.js:1019) TypeError: this.asyncConnection is null
2009-10-02 12:34:52	gloda.everybody	INFO	... loading resource://app/modules/gloda/noun_tag.js
2009-10-02 12:34:52	gloda.everybody	INFO	+++ loaded resource://app/modules/gloda/noun_tag.js
2009-10-02 12:34:52	gloda.everybody	INFO	... loading resource://app/modules/gloda/noun_freetag.js
2009-10-02 12:34:52	gloda.NS	INFO	Defining noun: freetag
2009-10-02 12:34:52	gloda.everybody	INFO	+++ loaded resource://app/modules/gloda/noun_freetag.js
2009-10-02 12:34:52	gloda.everybody	INFO	... loading resource://app/modules/gloda/noun_mimetype.js
2009-10-02 12:34:52	gloda.NS	INFO	Defining noun: mime-type
2009-10-02 12:34:52	gloda.everybody	ERROR	!!! error loading resource://app/modules/gloda/noun_mimetype.js
2009-10-02 12:34:52	gloda.everybody	ERROR	(undefined:53) [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: file:///opt/homes/daniele/thunderbird/modules/gloda/everybody.js :: loadModule :: line 53"  data: no]
2009-10-02 12:34:52	gloda.everybody	INFO	... loading resource://app/modules/gloda/index_ab.js
2009-10-02 12:34:52	gloda.indexer	INFO	Registering indexer: ab_indexer
2009-10-02 12:34:52	gloda.everybody	INFO	+++ loaded resource://app/modules/gloda/index_ab.js
2009-10-02 12:34:52	gloda.abattrs	ERROR	Error in init: TypeError: this.asyncConnection is null
2009-10-02 12:34:52	gloda.everybody	ERROR	!!! error initializing resource://app/modules/gloda/index_ab.js
2009-10-02 12:34:52	gloda.everybody	ERROR	(file:///opt/homes/daniele/thunderbird/modules/gloda/datastore.js:1019) TypeError: this.asyncConnection is null
-- Exception object --
+ message (string) 'nounDef is undefined'
+ fileName (string) 'file:///opt/homes/daniele/thunderbird/modules/gloda/gloda.js'
+ lineNumber (number) 1885
+ stack (string) 440 chars
+ name (string) 'TypeError'
*
-- Stack Trace --
<top>
nsAutoCompleteGloda@file:///opt/homes/daniele/thunderbird/components/glautocomp.js:505
anonymous@file:///opt/homes/daniele/thunderbird/modules/XPCOMUtils.jsm:245
[anonymous]@null:0
[anonymous]@chrome://messenger/content/search.xml:211


Reproducible: Always

Steps to Reproduce:
1.Launch thunderbird
This sounds like there is something very wrong with your global-messages-db.sqlite file.  Can you go into your profile dir and see
Component: Search → Database
OS: Linux → All
Product: Thunderbird → MailNews Core
QA Contact: search → database
Hardware: x86 → All
Summary: Gloda search tab is empty. Get an error during startup when loading resources. → Gloda does not protect against exceptions thrown by openUnsharedDatabase on corrupt databases
Whiteboard: [gloda key]
Forgot to finish my message.

I would just delete the global-message-db.sqlite file from your profile and that should fix the problem you are experiencing.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I deleted global-messages-db.sqlite and restarted thunderbird.
I left it indexing overnight and after restart the problem happens again.

I will retry and I'll capture the output but it takes a while to index my 13gb of email.
It is surprising that your database would be repeatedly getting corrupted.  Please confirm that:

1) Thunderbird is being shutdown cleanly; it does not get force-quit and the computer does not crash or otherwise lose power until after Thunderbird has quit.

2) The profile is on a local hard disk, not a network share or external USB/memory card device.

3) The hard disk is not running out of free space.

4) You have no anti-virus program or other daemon process that might try and interfere with file access or re-write files.

Also, is your computer stable in general?  Bad memory is always a possibility.
Thunderbird has been closed normally.
The profile is on my local disk, the partition has ~220Gb of free space
No antivirus or whatever, fedora 10, thunderbird 3.0b4 from Remi Collet repository (http://blog.famillecollet.com/pages/Config-en)

It's still reindexing my email, the sqlite database is now about 840Mb

I'll send a reply when it finishes reindexing.
I'd strongly suggest switching to 3.0RC1.  We've fixed a bunch of bugs since b4.
Whoops I missed the new release. 
I will try it.
I have installed 3.0RC1 , deleted the database and reindexed all my email (it took about 15 hours) and now everything works well.
Thanks for the assistance.
which is not to say we should nuke the test.
Assignee: nobody → bugmail
Status: NEW → ASSIGNED
Attachment #429057 - Flags: review?(bienvenu)
Attachment #429057 - Flags: review?(bienvenu) → review+
Attachment #429057 - Attachment description: v1 nuke corrupt databases and the test → v1 nuke corrupt databases and the test http://hg.mozilla.org/comm-central/rev/2ef0736c98be
pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/2ef0736c98be
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: