Skip to content

Mysterious Firefox error "An unexpected error occurred" #10091

@sentry

Description

@sentry

Sentry Issue: METAMASK-6KK0

Error: An unexpected error occurred

This error occurs only on Firefox, and doesn't include a stack trace. Another common trend is that appState is always set to an empty object.


Steps to reproduce

There are no steps to easily reproduce this bug.

All we know so far is that:

  • Issue is sill happening in 13.9.0 (december 2025)
  • Issue is a long-standing Firefox compatibility issue, not something new
  • Occurs even without private browsing mode enabled
  • State logs can't be accessed
  • Console logs are the following

Image

Root cause analysis

Firefox's storage API is corrupted

  • Firefox's extension storage system (SQLite database) can become corrupted and throw an error (see comment)
  • There is a user who is very active in helping people out in our community forum who created an entire tool to help solve this problem: https://github.com/0xLuigi/sql-metamask-id-viewer
    • The SQLite file Firefox uses for extension storage somehow gets corrupted, and users have found that incrementing the filename by one fixes the issue surprisingly often. The step-by-step instructions are here, the tool just helps with locating the correct file.

"Restore Vault Backup" flow doesn't trigger

  • "Restore Vault Backup" happens when storage.local does not contain vault data AND when there is a vault backup
    • The storage API we use for "Restore Vault Backup" feature (indexedDb) is only available when private browsing mode is not enabled, but in the reports we've got, private browsing mode was not enabled, so the issue shouldn't come from there
    • "Restore Vault Backup" doesn't happen when an error is thrown while we try to read wallet state (in storage.local). This is intentional because we wanted the ability to catch these unknown start up errors. We don't want to encourage "Restore Vault Backup" for potentially recoverable errors. This could explain why "Restore Vault Backup" flow doesn't trigger.

To be investigated

We should figure out whether or not users who are facing this issue have available disk space or not (low storage can cause database corruption).

Potentially related issues

Useful links

Metadata

Metadata

Labels

Type

No type

Projects

Status

To be triaged

Relationships

None yet

Development

No branches or pull requests

Issue actions