# Troubleshooting IndexedDB Errors

### Background

PixieBrix uses the browser's on-device high-performance [IndexedDB database](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) to store package/mod definitions and logs.

In the Extension Console, Sidebar, and Page Editor, PixieBrix will show a banner if it's unable to connect to IndexedDB:

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FQlLrfpIUDSHgNTUxhjPP%2Fimage.png?alt=media&#x26;token=b56e817c-e349-4a59-8f6b-ce8b88f23197" alt="" width="423"><figcaption><p>Banner displayed if PixieBrix cannot connect to the on-device IndexedDB</p></figcaption></figure>

Additionally, PixieBrix may report one of the following errors:

* Internal error opening backing store for IndexedDB.open
* Failed to read large IndexedDB value
* IndexedDB Full
* Encountered full disk while opening backing store for indexedDB.open

### Solution 1: restart the browser profile

In many cases, restarting the browser will correct the problem. Because, when Chrome restarts, it will force close all local database connections.

### Solution 2: delete local databases via the Chrome Developer Tools

{% hint style="info" %}
This solution requires that your organization does not restrict your access to the Chrome Developer Tools. See [Chrome documentation](https://knowledge.workspace.google.com/kb/manage-developer-tools-for-chrome-browser-000009587)
{% endhint %}

* Open the PixieBrix Extension Console by either:
  * Open the PixieBrix sidebar and click the gear icon in the upper-right
  * Navigate directly to:
    * Stable Release: `chrome-extension://mpjjildhmpddojocokjkgmlkkkfjnepo/options.html`
    * Beta Release: `chrome-extension://mpapkmgkphbggmlekkfnoilmafnbfile/options.html`
* Open the Chrome Dev Tools by either:
  * Right click on the page and select "Inspect", or:
  * Press F12
* If `Inspect` is disabled in the context menu for the page, contact your organization administrator to get access to the Chrome Dev Tools. See [Chrome documentation](https://knowledge.workspace.google.com/kb/manage-developer-tools-for-chrome-browser-000009587)
* Click on the Applications tab
* Under Storage > IndexedDB, for each of the following databases, select the database and click the `Delete database` button in the detail pane:
  * `BRICK_REGISTRY`
  * `LOG`
  * `TRACE`
  * `telemetrydb`

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2F6GuqjMBHXyeC5iAOxXZ9%2Fimage.png?alt=media&#x26;token=731922f6-3932-462b-8c9c-b2ac74d2401f" alt="" width="563"><figcaption><p>Select each database under Storage > IndexedDB and click the "Delete database" button</p></figcaption></figure>

### Solution 3: manually delete IndexedDB files from the file system

* Locate the IndexedDB storage location:
  * Navigate to the IndexedDB internals page:
    * Stable Release: `chrome://indexeddb-internals/#chrome-extension://mpjjildhmpddojocokjkgmlkkkfjnepo`
    * Beta Release: `chrome://indexeddb-internals/#chrome-extension://mpapkmgkphbggmlekkfnoilmafnbfile`
  * Locate the database paths under "Paths"

    <figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FG6vuC1FPpV9deVqmAE1g%2Fimage.png?alt=media&#x26;token=1a932e28-fa48-4966-a10b-2e4078a86f59" alt="" width="563"><figcaption><p>Locating the IndexedDB paths on the IndexedDB internals page</p></figcaption></figure>
* Close Chrome. Closing Chrome which will cause Chrome to close all connections to the database and release it's locks on the directories/files
* On Windows, delete the IndexedDB folders for the PixieBrix extension. For example, on Windows (replace `<username>` with your username):&#x20;

```
C:\Users\<username>\AppData\Local\Google\Chrome\User%20Data\Default\IndexedDB\chromeextension_mpjildhmpddojocokjkgmlkkkfjnepo_0.indexeddb.leveldb\
C:\Users\<username>\AppData\Local\Google\Chrome\User%20Data\Default\IndexedDB\chromeextension_mpjildhmpddojocokjkgmlkkkfjnepo_0.indexeddb.blob\
```

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FTe3ZXjflJaOg7EKqn8xs%2Fimage.png?alt=media&#x26;token=0386edf9-7be7-4fe7-b757-f3564f48ff65" alt="" width="563"><figcaption><p>Folders to delete on Windows</p></figcaption></figure>

* Re-open Chrome

### Solution 4: recover local databases

{% hint style="info" %}
These steps require the PixieBrix support team to enable Extension Storage Diagnostics for your account. Email <support@pixiebrix.com> for access before completing the steps
{% endhint %}

* Close local database connections:

  * In a new Chrome tab, visit the IndexedDB Internals page:&#x20;
    * Stable Release: `chrome://indexeddb-internals/#chrome-extension://mpjjildhmpddojocokjkgmlkkkfjnepo`
    * Beta Release: `chrome://indexeddb-internals/#chrome-extension://mpapkmgkphbggmlekkfnoilmafnbfile`
  * Click "Force Close"

  <figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FLfnpN9oLukjuEKcKEW1J%2Fimage.png?alt=media&#x26;token=123eafc7-b098-4c0b-8cb7-a0a55ea80e49" alt="" width="563"><figcaption><p>Click "Force Close" to force close local database connections</p></figcaption></figure>
* Recover the local PixieBrix databases
  * Navigate to the Extension Console > Settings page, by either:
    * Open the Extension Console, and click "Settings" in the left side-nav, or
    * Navigate directly to: `chrome-extension://mpjjildhmpddojocokjkgmlkkkfjnepo/options.html#/settings`
  * Click "Recover Databases". If you do not seen the "Extension Storage Statistics" section, contact <support@pixiebrix.com>

    <figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FWP9Tjp7mpwqKHOoLJsDj%2Fimage.png?alt=media&#x26;token=dbb85bb7-db5e-4887-8ff5-b4ff52be4246" alt="" width="375"><figcaption><p>Click "Recover Databases" to recover the local database</p></figcaption></figure>

### Frequently Asked Questions

#### How do I determine if my Chrome profile is corrupted?

*Method 1: create a new Chrome profile*

* [Create a new Chrome profile](https://support.google.com/chrome/answer/2364824?hl=en\&co=GENIE.Platform%3DDesktop) and install the PixieBrix extension
* If PixieBrix works in the the new profile, that indicates your other profile is corrupt

*Method 2: delete your existing Chrome profile*

{% hint style="info" %}
Before deleting your Chrome profile, back up your bookmarks or any other information if it's not synced with your Google Account
{% endhint %}

* Visit `chrome://version/` in a new tab
* Find "Profile Path" and copy the folder path for your profile
* Close Chrome completely
* In File Explorer (Windows) or Finder (Mac), open the profile path you copied
* Delete the directory
* Open Chrome

#### How do I determine if IndexedDB database connections are blocked/deadlocked?

* In a new Chrome tab, visit:
  * Stable Release:  `chrome://indexeddb-internals/#chrome-extension://mpjjildhmpddojocokjkgmlkkkfjnepo`
  * Beta Release: `chrome://indexeddb-internals/#chrome-extension://mpapkmgkphbggmlekkfnoilmafnbfile`
* Refer to the "Open Connections:" count.
* Chrome will also display the status of open connections, e.g., Running, Blocked, etc.
* &#x20;If a transaction is blocking other transactions, you'll see a transaction as "Running" with other transactions marked as "Blocked"

#### **How do I fix an "Unable to create sequential file" error?**

The error "IO Error: .../NNNNN.log: Unable to create sequential file" indicates Chrome is unable to create an IndexedDB transaction file. To fix the error, complete the IndexedDB recovery steps described above.
