IndexedDB error: InvalidStateError

My WebExtension uses IndexedDB to store user data. Some of my users who are migrating from the older legacy XUL version of my extension are reporting issues with inability to import their RDF data to the new WebExtension. The error that has been observed is:

InvalidStateError A mutation operation was attempted on a database that did not allow mutations.

This suggests that the user’s IndexedDB database doesn’t have sufficient privileges to write data to it. Is there a way to fix this so that the RDF data import works?

I occasionally encounter this issue too. And it seems a lot more frequent in WebExtensions when developing, for users it seems a little less common.

For users this issue usually comes from a corrupted indexed db that happened by downgrading a profile (i.e. using Firefox 57 and then using the same profile in 54 and then 57 again).

The workaround I suggest to my users is to “refresh Firefox” if it doesn’t work at all anymore. Sometimes deleting the database and creating it fresh fixes the issue.

I’m having the opposite experience. I have never encountered this issue, but many of my users have, which has made them very angry.