Couldn't open SQLite database error message

9 views
Skip to first unread message

sobolanul

unread,
Jan 27, 2009, 2:47:25 AM1/27/09
to Gears Users
Hi.

I am working on a big application that is using Gears for offline
functionality. Offline mode is live from almost an year and it is used
by tens of thousands of people.

Problem is that from a month or so, I keep receiving error emails with
message: "Gears initialization failure. : Error - Couldn't open SQLite
database.".
I was never able to reproduce this error, I only see it in the auto
error mailing system. I investigated for a while, but couldn't find
anything about it.

What I found about this was an old gears bug:
http://code.google.com/p/gears/issues/detail?id=236, but I tested the
scenario and is not the case. Then, looking in Gears source code, I
found this error string in only one place:

// For now, callers cannot open DBs in other security origins.
// To support that, parse an 'origin' argument here and call
// IsOriginAccessAllowed (yet to be written).

// Open the database.
if (!OpenSqliteDatabase(database_name.c_str(), EnvPageSecurityOrigin
(),
&db_)) {
RETURN_EXCEPTION(STRING16(L"Couldn't open SQLite database."));


Again, I do not think this is the case for me.

So, if anyone has any idea why I get this error message, please point
me in some direction.


Thanks,
Eduard

sobolanul

unread,
Jan 30, 2009, 5:03:13 AM1/30/09
to Gears Users
No ideas? I am really stuck with this

Michael Nordman

unread,
Jan 30, 2009, 4:12:22 PM1/30/09
to gears...@googlegroups.com, eduard....@gmail.com
Hi Eduard,

>> I am working on a big application that is using Gears for offline
>> functionality. Offline mode is live from almost an year and it is used
>> by tens of thousands of people.

Nice!

>> RETURN_EXCEPTION(STRING16(L"Couldn't open SQLite database."));

This sure does look like the return path your running into. It is
possible for SQLite databases to become corrupt. Gears tries to
discard them as they are discovered and create new empty databases in
those cases (see OpenAndCheckDatabase in database_utils.cc). It could
be that this database is corrupt in some way that our detection logic
doesn't recognize?

Have you retrieved any of these database files from a user
experiencing this problem?

-Michael

Reply all
Reply to author
Forward
0 new messages