pouchdb: Error indexed_db_went_bad on reading from a database
Issue
Error on reading data from a pouch database:
{status: 500, name: "indexed_db_went_bad", message: "unknown", error: true, reason: "DataError"}
The database has auto compaction enabled, and is continuously replicated from
a remote couch db database. Currently, this database has only 4 documents, but they are updated very frequently (every 10 seconds or so). This error cropped up after a few days of the application running on the target system. The application typically runs for around 12 hours everyday, and this replication is active during the entire time.
Info
- Pouch Version - 6.3.4
- Environment: (browser)
- Platform: (Chrome)
- Adapter: (IndexedDB)
- Server: (CouchDB)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 48 (2 by maintainers)
Any news? Why is this issue closed? This bug still happens occasionally.
Thanks a lot, this investigation is awesome. So from I can guess at from the comments, I am not convinced there is anything broken with
auto_compaction
itself, however it looks like some recent changes in chrome have caused it to not be able to handle a large volume of writes consistently, andauto_compaction
will trigger a lot of writes.Will see about writing a script to reproduce and ask any chrome developers if they know of anything like this on their radar
I have the same issue. Application creates about 6 000 documents per 2 hours Randomly at some point of time IDB send error ‘Failed to read large IndexedDB value’.
After investigations i realized that IDB contain 1 document that cannot be fetched. That broken document is often changing in application (may be changed 1000 times per 2 hours)
Looks like this issue more related to IndexedDB itself. I don’t know how to reproduce this issue manually, had try to create very large document and do read/write with IDB - but it works well. In source files of Chromium i found one mentioning about this error https://github.com/chromium/chromium/blob/94be0097939ef4938459e4ffa8dbc9a2ed45dda0/third_party/WebKit/Source/modules/indexeddb/IDBRequestLoader.cpp#L135
Info
ok so the chrome fix for this has landed, I will call out the bug in the release notes since its pretty severe but otherwise very hard for us to do anything reliably to fix bugs in chrome migrations so closing this out, if your bug isnt the chrome issue and you can reproduce with latest pouch / latest browsers please file a new bug
We are having the same issue:
{"status":500,"name":"indexed_db_went_bad","message":"unknown","reason":"UnknownError"}
User-Agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1
The error happens on iPhone Safari 11.3 when we attempt to retrieve or save a document (via
db.get
ordb.put
).Looks like https://bugs.chromium.org/p/chromium/issues/detail?id=756447.
All bugs in IndexedDB (including fixed etc.): https://bugs.chromium.org/p/chromium/issues/list?can=1&q=component%3ABlink>Storage>IndexedDB
And this maybe useful, looks like a list of changes in
indexeddb
: https://chromium.googlesource.com/chromium/src.git/+log/master/third_party/WebKit/Source/modules/indexeddbI just realized that one of the changes I did which may have resolved it for me, was to disable auto compaction. I sync weekly databases to the pouch client and delete old ones, so I don’t need auto compaction. This could’ve been what solved it for me too.
Soo from few days I have a similar problem.
In browser in chrome version 78.0.3904.108 I can see:
{status: 500, name: “indexed_db_went_bad”, message: “unknown”, error: true, reason: “DataError”}
And this problem is when I replicate from server document types attachement,example :
{ “_id”: “attachemnt214”, “_rev”: “1-1b071ca0213bda5922ab8a8d34c02c94”, “_attachments”: { “att”: { “content_type”: “image/png”, “revpos”: 1, “digest”: “md5-96ahm+XEqSo2PZ4r2XgnRA==”, “length”: 11114, “stub”: true } } }
The same problem is on android application but about one week ago this worked.
What’s wrong, is it a problem Chrome ?
With PouchDB 7.0.0:
Google Chrome Version 69.0.3497.100 (Official Build) (64-bit) (Windows)
Killing Chrome completely via the Task Manager and all the little help processes and relaunch caused it to work again.
Chrome 64 and 65 were broken. Chrome 66 is fine.