Skip to content

OPFSCoopSyncVFS: NoModificationAllowedError on page reload after manual browser storage clear in chrome #296

Closed

Description

@lumosminima

It seems like when we manually clear browser storage in google chrome the access handles aren't released properly (probably because files are gone before VFS's jClose has a chance?) so when we reload after clearing it gets stuck in the 'NoModificationAllowedError' only fully closing google chrome and reopening it fixes it. On firefox v144.0 this doesn't happen or I'm unable to produce it but here are the steps to reproduce it in the demo link in chrome using the OPFSCoopSyncVFS.

NoModificationAllowedError: Failed to execute 'removeEntry' on 'FileSystemDirectoryHandle': An attempt was made to modify an object where modifications are not allowed.
  • And without the &reset the error is always this:
NoModificationAllowedError: Failed to execute 'createSyncAccessHandle' on 'FileSystemFileHandle': Access Handles cannot be created if there is another open Access Handle or Writable stream associated with the same file.

Error: sqlite3_open_v2
    at check (https://rhashimoto.github.io/wa-sqlite/src/sqlite-api.js:864:11)
    at Object.open_v2 (https://rhashimoto.github.io/wa-sqlite/src/sqlite-api.js:498:9)
    at async https://rhashimoto.github.io/wa-sqlite/demo/demo-worker.js?build=asyncify&config=OPFSCoopSyncVFS:98:14
  • Close the browser and reopen to see error gone.

I was testing this path for an easy "reboot" like "Just clear your browser storage and reload" if user's db is corrupted due to app level mishandling or is not migrated properly etc so they can easily just clear their browser storage and resume from a fresh state.

Environment

Google Chrome v141.0.7390.108
wa-sqlite v1.0.9 (VFS: OPFSCoopSyncVFS)

Activity

  1. rhashimoto commented on Oct 20, 2025

    @rhashimoto
    Owner

    @lumosminima What platform are you on? I'm using the same version of Chrome, but I can't reproduce the error. I'm on an Apple M2 mini running macos 15.6.1 (Sequoia).

    I understand your motivation, and it's a good one, but I'm not sure this falls within my responsibility or even under my control.

  2. lumosminima commented on Oct 21, 2025

    @lumosminima
    Author

    @rhashimoto I'm running on Windows 11 25H2 (OS Build 26200.6899). I understand since there is no "beforeStorageClear" event which could probably be used to properly close the db and release handles when files are not yet cleared. I wasn't sure but I guess this is a chrome specific limitation on windows and not a bug in wa-sqlite so I will just catch this error and direct user to restart their browser in case this path is ever taken by user.

    EDIT: I've opened an issue on chromium regarding this: https://issues.chromium.org/issues/453704691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions