NS_ERROR_FILE_CORRUPTED

Fix Firefox NS_ERROR_FILE_CORRUPTED – Bookmarks & History Lost

Software – Web Browsers Intermediate 👁 0 views 📅 May 26, 2026

This error hits when your bookmarks or history database gets corrupted. We'll walk you through three fixes, from a quick reset to rebuilding the database manually.

Why You're Seeing NS_ERROR_FILE_CORRUPTED

This error usually pops up after Firefox crashes, your computer shuts down unexpectedly, or a disk check runs while Firefox is open. The places.sqlite file—where Firefox stores your bookmarks, history, and favicons—got corrupted. I've seen this happen on Windows 10 after a forced update reboot, and on macOS during a kernel panic. The fix? It depends on how deep the damage is.

Quick Fix (30 seconds): Refresh the Places Database

Firefox has a built-in repair tool that rebuilds the places database from your latest automatic backup. This works about 60% of the time.

  1. Open Firefox. If it crashes immediately, launch it in Safe Mode: hold Shift when opening Firefox (Windows/Linux) or hold Option (Mac).
  2. Type about:support in the address bar and press Enter.
  3. Under the "Places Database" section, click the button that says "Verify Integrity".
  4. A small dialog will appear. Click "Yes".
  5. Wait 5-10 seconds. You'll see either "The database has been successfully checked" or "The database is corrupted and has been replaced."

If it reports success, close and reopen Firefox. Your bookmarks and history should be back. If not, or if the error reappears, move to the moderate fix.

Moderate Fix (5 minutes): Recover from a Backup

Firefox keeps up to 5 automatic backups of your places.sqlite file. I've saved dozens of users by pulling one of these.

  1. Completely close Firefox.
  2. Open your Firefox profile folder:
    • Windows: Press Win+R, type %APPDATA%\Mozilla\Firefox\Profiles\, press Enter.
    • macOS: Open Finder, press Cmd+Shift+G, type ~/Library/Application Support/Firefox/Profiles/.
    • Linux: Open file manager, go to ~/.mozilla/firefox/.
  3. Look for a folder named something like xxxx.default-release (the random prefix varies). Open it.
  4. Inside, find these files:
    • places.sqlite (this is the broken one)
    • places.sqlite.corrupt (Firefox may have renamed it)
    • places.sqlite-wal and places.sqlite-shm (ignore these)
  5. Now look for backup files named places.sqlite.1, places.sqlite.2, etc. (up to .5).
  6. Rename the current places.sqlite to places.sqlite.bak in case you need it later.
  7. Copy the highest-numbered backup (e.g., places.sqlite.5) and rename it to places.sqlite.

Launch Firefox. If you see your bookmarks and history, you're golden. If not, or if the error persists, go to the advanced fix. Note: this won't restore bookmarks added after the backup was made.

Advanced Fix (15+ minutes): Manual Database Repair

This is the nuclear option. You'll use Firefox's built-in SQLite repair tool from the command line. I use this when the GUI fixes fail—it's rescued bookmarks from databases that looked completely dead.

  1. Close Firefox.
  2. Locate your profile folder (same path as above).
  3. Open a command prompt/terminal in that folder:
    • Windows: Shift+Right-click in the folder, select "Open PowerShell window here".
    • macOS/Linux: Right-click in the folder, select "Open Terminal here" (or use cd to navigate there).
  4. Run this command to create a backup and attempt repair:
    copy places.sqlite places.sqlite.bak
    (On macOS/Linux, use cp places.sqlite places.sqlite.bak)
  5. Now run the SQLite repair from Firefox's internal tools:
    firefox -P default-release -no-remote -sqlite-repair
    If your profile isn't named "default-release," list profiles first with firefox -P and choose the right one.
  6. Wait for Firefox to open. It'll show a "Rebuilding places database..." dialog. Let it finish completely before interacting with the browser.
  7. Check your bookmarks and history. They should be restored.

If that still fails, you can try a manual SQLite dump (advanced users only):

  1. Download SQLite command-line tool from sqlite.org.
  2. In the terminal, run:
    sqlite3 places.sqlite .dump > places_dump.sql
  3. If the dump succeeds, create a new database:
    sqlite3 new_places.sqlite < places_dump.sql
  4. Replace the original places.sqlite with this new file.

I've seen this work when everything else failed, but it's a last resort. If none of these fix it, your data may be beyond recovery—consider using the "Restore Previous Session" feature from the History menu if it's available, or re-import bookmarks from a JSON backup (File > Import and Backup > Restore).

Pro tip: Once you're back up, install the "Bookmarks Backup" add-on to auto-export bookmarks weekly. It's saved me more than once.

Got questions? Drop a comment below—I read every one.

Was this solution helpful?