搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Unlimited storage is not unlimited for IndexedDB

more options

I have been using a DB in IndexedDB for quite a while. As time passed, I increased its permissions allowing it to store unlimited data. Currently the DB I'm using is using ~680MB of storage.

This started happening in firefox 41.0.1 but I can still reproduce it in Nightly.

When I try to open the DB (even before I try doing anything) I get the QuotaExceededError error with the message: "The current transaction exceeded its quota limitations."

This wasn't happening until I updated to firefox 41. How do I solve it?

Note: I posted this question here by request on https://bugzilla.mozilla.org/show_bug.cgi?id=1212985

I have been using a DB in IndexedDB for quite a while. As time passed, I increased its permissions allowing it to store unlimited data. Currently the DB I'm using is using ~680MB of storage. This started happening in firefox 41.0.1 but I can still reproduce it in Nightly. When I try to open the DB (even before I try doing anything) I get the QuotaExceededError error with the message: "The current transaction exceeded its quota limitations." This wasn't happening until I updated to firefox 41. How do I solve it? Note: I posted this question here by request on https://bugzilla.mozilla.org/show_bug.cgi?id=1212985

所有回覆 (3)

more options

Well, it's a little hard for Support volunteers to research, but I took a quick look in the code at what kinds of things cause this error message and they all seem to relate not to a site-specific quota but to available disk space. Or perhaps it's some maximum on IndexedDB as a whole?

(Excerpted from https://dxr.mozilla.org/mozilla-central/source/dom/base/domerr.msg)

DOM4_MSG_DEF(QuotaExceededError, "The current transaction exceeded its quota limitations.", NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR)

(Excerpted from https://dxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp)

case NS_ERROR_FILE_NO_DEVICE_SPACE:   return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;

NS_WARNING("Refusing to create database because disk space is low!"); return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;

if (rv == NS_ERROR_FILE_NO_DEVICE_SPACE) {
  // mozstorage translates SQLITE_FULL to NS_ERROR_FILE_NO_DEVICE_SPACE,
  // which we know better as NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR.
  rv = NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;

if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) {
  NS_WARNING("Refusing to create file because disk space is low!");
  return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
more options

Thank you for your patience.

I can give you some feedback on that. The warning message: "Refusing to create database because disk space is low!" Does not appear on any of both consoles. The drive where the firefox profile is, at that time, had aprox 30GB of free storage space.

I also did some scrapping on the source code (thanks for showing me somewhere to start on).

I ended up with stuff such as:

http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp#4511 Which leads to: https://www.sqlite.org/rescode.html#full

Which makes me ask... Did firefox change SQLLite's version? Did firefox change filepaths where the temp files are created? I'm talking something that happened between firefox version 39.0.3 and version 41.

There's also this here: http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/IndexedDatabaseManager.cpp#686 (IndexedDatabaseManager::InLowDiskSpaceMode())

And to find the values, I found this; https://dxr.mozilla.org/mozilla-central/source/hal/gonk/GonkDiskSpaceWatcher.cpp#166 For me, this seems that it should only genuinely consider the disk as full if it has only 10MB or less (after reaching 5MB of space). In other words, it should never ever have considered as being out of space.

Any more ideas?

由 brunoais 於 修改

more options

Sorry, this is beyond my ability to research any further.