IndexedDB: Suddenly, all of my callbacks are no longer called (?)

1,031 views
Skip to first unread message

Mathieu D

unread,
Aug 27, 2012, 8:20:22 AM8/27/12
to chromiu...@chromium.org
I have been running the same script for more than a year without a problem, but suddenly I can't open the DB anymore. The callbacks are no longer called. It's quite mysterious!

E.g.:
request = window.indexedDB.open(databaseName, "Example");
request.onblocked = function(e) {
addLog('couldn\'t open DB (blocked)', 'error');
...
};
request.onabort = function(e) {
addLog('couldn\'t open DB (abort)', 'error');
...
};
request.onupgradeneeded = function(e) {
addLog('DB upgrade needed');
...
}
request.onsuccess = function(e) {
addLog('DB successfully opened');
...
};
request.onerror = function(e) {
addLog('couldn\'t open DB (error)', 'error');
...
};

The logs won't display anymore, the callbacks aren't called. I have the same problem when I try to delete a database, not any callback is called.

I would REALLY appreciate any help as my application is broken for some users! Thank you!

Eric Bidelman

unread,
Aug 27, 2012, 12:00:35 PM8/27/12
to Mathieu D, chromiu...@chromium.org
What version of Chrome are you using? Canary (M23) has recently
seen a bunch of spec updates See chromestatus.com for the details.


--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msg/chromium-html5/-/u6r8dzUSA9gJ.
To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.

Joshua Bell

unread,
Aug 27, 2012, 12:09:16 PM8/27/12
to Eric Bidelman, Mathieu D, chromiu...@chromium.org
What version(s) of Chrome, and what Operating System?

crbug.com/143680 has been reported but we haven't reproduced it locally. (Now that the weekend is over we may have more luck).

Note that the second argument to open() is an integer version; passing a string is not supported. Is the call throwing an exception, perhaps?

Alec Flett

unread,
Aug 27, 2012, 1:05:50 PM8/27/12
to Mathieu D, chromiu...@chromium.org
I've been able to reproduce parts of this on canary just in the JS console.
I got some interesting results, so I pasted them into the bug:
http://crbug.com/143680

Alec
On Mon, Aug 27, 2012 at 5:20 AM, Mathieu D <mett...@gmail.com> wrote:

--

Joshua Bell

unread,
Aug 27, 2012, 3:04:49 PM8/27/12
to Alec Flett, Mathieu D, chromiu...@chromium.org
Well, good news/bad news. I'm able repro but only in Windows Canary, not a local Linux Debug build from tip-of-tree.

Here's the page I'm using:

<!DOCTYPE html>
<script>
var databaseName = "db" + Date.now(); // New each time
request = window.webkitIndexedDB.open(databaseName, "Example");
console.log("request:", request);
request.onblocked = function(e) { console.log("DB open blocked", e); };
request.onupgradeneeded = function(e) { console.log("DB open upgrade needed", e); };
request.onsuccess = function(e) { console.log("DB open success", e.target.result); };
request.onerror = function(e) { console.log("DB open error", e); };
</script>

Since this seems to be the same issue, further updates/discussion should go into the bug:

Mathieu D

unread,
Aug 28, 2012, 9:25:49 AM8/28/12
to chromiu...@chromium.org
I tested with versions:
23.0.1243.2 dev-m
23.0.1246.0 dev-m

I have Windows XP Pro SP2 32 bit

Callbacks are no longer called.
Do you want me to test anything?

Joshua Bell

unread,
Aug 28, 2012, 12:09:32 PM8/28/12
to Mathieu D, chromiu...@chromium.org
Nope - keep an eye on http://crbug.com/143680. We've identified the cause (Windows only, compiler specific) and have a fix in progress.

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.

David Grogan

unread,
Aug 29, 2012, 2:47:16 PM8/29/12
to Mathieu D, chromiu...@chromium.org
On Mon, Aug 27, 2012 at 5:20 AM, Mathieu D <mett...@gmail.com> wrote:
I have been running the same script for more than a year without a problem, but suddenly I can't open the DB anymore. The callbacks are no longer called. It's quite mysterious!


 
E.g.:
request = window.indexedDB.open(databaseName, "Example");

You should either remove "Example" or change it to an integer. indexedDB.open used to take a string as a second parameter but that's been out of the spec for >1 year.

request.onblocked = function(e) {
addLog('couldn\'t open DB (blocked)', 'error');
...
};
request.onabort = function(e) {
addLog('couldn\'t open DB (abort)', 'error');
...
};
request.onupgradeneeded = function(e) {
addLog('DB upgrade needed');
...
}
request.onsuccess = function(e) {
addLog('DB successfully opened');
...
};
request.onerror = function(e) {
addLog('couldn\'t open DB (error)', 'error');
...
};

The logs won't display anymore, the callbacks aren't called. I have the same problem when I try to delete a database, not any callback is called.

I would REALLY appreciate any help as my application is broken for some users! Thank you!

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.

Gene Vayngrib

unread,
Dec 29, 2012, 1:59:23 PM12/29/12
to chromiu...@chromium.org, Mathieu D
I also have this problem, was working yesterday and for a month before it. I suspect that my Chrome 23.0.1271.97 m (Win XP) got updated and it caused this problem. I am not opening the database with a second string parameter, so this is ruled out. One interesting thing: Dev tools resources tab shows my database, but unlike in Chrome on other machines, it does not show properties:

Security origin
Name
Database version

Also, not a single table is showing.
So, it seems IndexedDB is stuck in some limbo state. Can't delete it via API either, as open() never calls any of the callbacks.
I can of course clear it from the settings, but if this occurs on the customer side, how can I handle this?

Gene Vayngrib

unread,
Jul 22, 2013, 11:16:56 AM7/22/13
to chromiu...@chromium.org
for those who might still be having IndexedDB issues, man we certainly suffered with it too much, so hope the info below will help:
We have greatly stabilized all our IndexedDB code by separating DDL operations from normal DB access. We created a queue and only start DDL operations when the queue is empty. This solved most of our IndexedDB instabilities and strange behavior. This code is part of our urbini mobile web dev framework on github

Alec Flett

unread,
Jul 22, 2013, 5:08:37 PM7/22/13
to Gene Vayngrib, chromium-html5
FWIW, We have also started adding a lot of under-the-covers status information about indexeddb to chrome's status page (chrome://indexeddb-internals), so you can get a feel for what "state" a give domain's databases are in - including which transactions are blocked on what, etc.. as well as the ability to force-close all connections to an IndexedDB so you don't have to totally restart your browser because you forgot to call close() and the connection managed to get leaked.

Some of this landed last week, more just landed in the last few hours, so you will see this in canaries today/tomorrow, dev builds later this week, and M30 when it gets cut.

Alec



--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.

To post to this group, send email to chromiu...@chromium.org.
Reply all
Reply to author
Forward
0 new messages