Error in local storage - NS_ERROR_FILE_CORRUPTED - firefox

I've been working in a web application and I'm using local storage. But for some Firefox users I notice that they're having the following error:

NS_ERROR_FILE_CORRUPTED: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [nsIDOMStorage.setItem]

when it called the function:

function setLocalStorageItem(key, value){ 
        localStorage.setItem(key, JSON.stringify(value));
}

It's is a way to avoid this error?


This is a browser-level error: you probably didn't do anything wrong to cause this error. The browser (or the the SQLite library it uses) either did something wrong, or the file was left in an invalid state due to a hardware problem.

You can't really prevent this issue, except by joining the Firefox development team and making the browser's storage system more fault-resistant. There doesn't seem to be any way to restore data from this error, so what you'll have to do is detect this error and tell users how to blow away their browser storage according to this MDN post:

try {
    setLocalStorageItem(key, value);
} catch(e) {
    if(e.name == "NS_ERROR_FILE_CORRUPTED") {
        showMessageSomehow("Sorry, it looks like your browser storage has been corrupted. Please clear your storage by going to Tools -> Clear Recent History -> Cookies and set time range to 'Everything'. This will remove the corrupted browser storage across all sites.");
    }
}

Note that the catch block should verify that the error is an NS_ERROR_FILE_CORRUPTED error. I think my check on e.name is correct, but you should verify it for yourself.

1341070, Resolving an NS_ERROR_FILE_CORRUPTED error in Mozilla Firefox Clearing my cache, my browser's local storage or restarting the browser was not​  "File error: Corrupted" nsresult: "0x8052000b (NS_ERROR_FILE_CORRUPTED)" location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1" data: no] In this case, re-running the commands again worked and resolved the issue.


After an OS crash files within the Firefox profile folder might be corrupt and lead to non-functional websites (in my case ironically the Firefox marketplace). Here, webappsstore.sqlite was affected.

As user @Oli stated over at Ask Ubuntu

Firefox stores its HTML5 data in a file called webappsstore.sqlite. That's sitting in your profile directory which lurks somewhere in ~/.mozilla/firefox/....default/ (depending on what your profile is called).

Move that out the way and restart Firefox and everything will come back to life.

More: https://developer.mozilla.org/en/dom/storage

If deleted/moved out of your profile folder, Firefox builds a new, sanitized webappsstore.sqlite file. Worked for me. Information on where to find your profile folder can be accessed here.

Resolving an NS_ERROR_FILE_CORRUPTED error in Mozilla Firefox, Firefox stores its HTML5 data in a file called webappsstore.sqlite . What fixed it for me when I had that error with BitBucket (again) was the clicking the content of webappsstore.sqlite , which contains local storage data. Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [nsIDOMStorage.getItem] I assume I'm getting this because the storage that Firefox uses for HTML5 local storage (which SE Chat uses to cache the session) has been corrupted by the dirty reboot.


How can I stop Firefox throwing a NS_ERROR_FILE_CORRUPTED , and the console is constantly spitting out NS_ERROR_FILE_CORRUPTED: . I'​ve tried clearing all data from Firefox's settings menu, and turned off all I assume this might be something related to the change to indexeddb and localstorage? Keep the defective profile and report the bug here: https://​bugzilla.mozilla.org. Handle NS_ERROR_FILE_CORRUPTED with localStorage Aug 10, 2015 shane-tomlinson added this to the FxA-0: quality milestone Sep 7, 2015 vladikoff added the good-first-bug label Dec 22, 2015


Had this problem just pop up with one of our clients.

Completely deleting the history and (I guess that is the important part) offline website data solved the problem.

(Firefox Version 40.0.3)

Handle NS_ERROR_FILE_CORRUPTED with localStorage · Issue , javascript Error in local storage NS_ERROR_FILE_CORRUPTED firefox? try { setLocalStorageItem(key, value); } catch(e) { if(e.name  try { setLocalStorageItem(key, value); } catch(e) { if(e.name == "NS_ERROR_FILE_CORRUPTED") { showMessageSomehow("Sorry, it looks like your browser storage has been corrupted. Please clear your storage by going to Tools -> Clear Recent History -> Cookies and set time range to 'Everything'.


Not sure if this helps but I have this issue on Jira. I restarted Firefox with addons disabled and wen to Jira and it worked. Then I stopped Firefox and restarted it with Addons enabled and it worked again. I don't know why this worked :) I use Firefox Developer edition 48.0a2 (2016-05-24)

"Your Browser Doesn't Support Local Storage" and, Also good to know: - Is this exactly the localStorage "​NS_ERROR_FILE_CORRUPTED" error, or just something similar? I ask because we've  try { setLocalStorageItem(key, value); } catch(e) { if(e.name == "NS_ERROR_FILE_CORRUPTED") { showMessageSomehow("Sorry, it looks like your browser storage has been corrupted. Please clear your storage by going to Tools -> Clear Recent History -> Cookies and set time range to 'Everything'.


javascript Error in local storage NS_ERROR_FILE_CORRUPTED , and I'm using local storage. But for some Firefox users I notice that they're having the following error: NS_ERROR_FILE_CORRUPTED: Component returned  Get Firefox help 🌐Get web NS_ERROR_FILE_CORRUPTED (0x8052000B) An attempt was made to add data into the local or global storage for a given domain that


1497738 – firefox local offline cache corruption, I've been working in a web application and I'm using local storage. But for some Firefox users I notice that they're having the following error:  I understand that I need to go to Account settings > Server settings > Local directory to change email storage location. This worked great for the first email I set up. However when I try to set up subsequent emails in this folder, or sub-directories of that folder, I get the message "The directory specified in the Local Directory setting is


Manage local site storage settings (Redirected from Storage API - some websites want to add files to my computer ) Some websites have the ability to store information, such as files, in your local storage, and these files can only be removed manually by you.