We've been encountering this error with various users on the Firefox Profiler front-end, and from what I can tell, we are accessing IndexedDB in the correct way, at least according to how MDN outlines it. I suspect there could be a browser bug here. We have Bug 1650627 on file, as well as the issue on our front-end code: https://github.com/firefox-devtools/profiler/issues/2637 I outlined the problem in [firefox-devtools/profiler/#2637](https://github.com/firefox-devtools/profiler/issues/2637). I will copy it here. The expected results are that the onupgradedneeded will always ensure that the symbol store exists, and that onsuccess will let us use it without errors. ------------ `_setupDB()` calls `const openReq = indexedDB.open(dbName, 2);`. `openReq.onupgradeneeded` is defined, and when run, creates the object store: ``` const store: SymbolStore = db.createObjectStore('symbol-tables', { keyPath: ['debugName', 'breakpadId'], }); ``` `openReq.onsuccess` is then definitely run, which calls `_deleteAllBeforeDate` This error is then generated on: `const transaction = db.transaction('symbol-tables', 'readwrite');` [According to MDN](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore): > [The createObjectStore] method can be called only within a versionchange transaction. We are doing this, then immediately, and synchronously with the onsuccess handler accessing the store. Here's a permalink with valid line numbers: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L97-L154 Plus here is the transaction that is generating the error: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L253
Bug 1653276 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
We've been encountering this error with various users on the Firefox Profiler front-end, and from what I can tell, we are accessing IndexedDB in the correct way, at least according to how MDN outlines it. I suspect there could be a browser bug here. We had Bug 1650627 on file, which we moved to our front-end repo: https://github.com/firefox-devtools/profiler/issues/2637 I outlined the problem in [firefox-devtools/profiler/#2637](https://github.com/firefox-devtools/profiler/issues/2637). I will copy it here. The expected results are that the onupgradedneeded will always ensure that the symbol store exists, and that onsuccess will let us use it without errors. ------------ `_setupDB()` calls `const openReq = indexedDB.open(dbName, 2);`. `openReq.onupgradeneeded` is defined, and when run, creates the object store: ``` const store: SymbolStore = db.createObjectStore('symbol-tables', { keyPath: ['debugName', 'breakpadId'], }); ``` `openReq.onsuccess` is then definitely run, which calls `_deleteAllBeforeDate` This error is then generated on: `const transaction = db.transaction('symbol-tables', 'readwrite');` [According to MDN](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore): > [The createObjectStore] method can be called only within a versionchange transaction. We are doing this, then immediately, and synchronously with the onsuccess handler accessing the store. Here's a permalink with valid line numbers: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L97-L154 Plus here is the transaction that is generating the error: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L253
We've been encountering this error with various users on the Firefox Profiler front-end, and from what I can tell, we are accessing IndexedDB in the correct way, at least according to how MDN outlines it. I suspect there could be a browser bug here. We had Bug 1650627 on file, which we moved to our front-end repo: https://github.com/firefox-devtools/profiler/issues/2637 I outlined the problem in [firefox-devtools/profiler/#2637](https://github.com/firefox-devtools/profiler/issues/2637). I will copy it here. The expected results are that the onupgradedneeded will always ensure that the symbol store exists, and that onsuccess will let us use it without errors. ------------ ``` Encountered error while cleaning out database: DOMException: IDBDatabase.transaction: 'symbol-tables' is not a known object store name symbol-store-db.js:151:18 onsuccess symbol-store-db.js:151 (Async: promise callback) onsuccess symbol-store-db.js:150 (Async: EventHandlerNonNull) _setupDB symbol-store-db.js:141 _setupDB symbol-store-db.js:97 SymbolStoreDB symbol-store-db.js:80 SymbolStore symbol-store.js:172 getSymbolStore receive-profile.js:823 finalizeProfileView receive-profile.js:224 Redux 2 loadProfile receive-profile.js:141 Redux 2 getProfileFromAddon receive-profile.js:807 retrieveProfileFromAddon receive-profile.js:916 Redux 2 getProfilesFromRawUrl receive-profile.js:1409 Redux 2 ``` `_setupDB()` calls `const openReq = indexedDB.open(dbName, 2);`. `openReq.onupgradeneeded` is defined, and when run, creates the object store: ``` const store: SymbolStore = db.createObjectStore('symbol-tables', { keyPath: ['debugName', 'breakpadId'], }); ``` `openReq.onsuccess` is then definitely run, which calls `_deleteAllBeforeDate` This error is then generated on: `const transaction = db.transaction('symbol-tables', 'readwrite');` [According to MDN](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore): > [The createObjectStore] method can be called only within a versionchange transaction. We are doing this, then immediately, and synchronously with the onsuccess handler accessing the store. Here's a permalink with valid line numbers: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L97-L154 Plus here is the transaction that is generating the error: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L253
We've been encountering this error with various users on the Firefox Profiler front-end, and from what I can tell, we are accessing IndexedDB in the correct way, at least according to how MDN outlines it. I suspect there could be a browser bug here. We had Bug 1650627 on file, which we moved to our front-end repo: https://github.com/firefox-devtools/profiler/issues/2637 I outlined the problem in [firefox-devtools/profiler/#2637](https://github.com/firefox-devtools/profiler/issues/2637). I will copy it here. The expected results are that the onupgradedneeded will always ensure that the symbol store exists, and that onsuccess will let us use it without errors. ------------ This is the error: ``` Encountered error while cleaning out database: DOMException: IDBDatabase.transaction: 'symbol-tables' is not a known object store name symbol-store-db.js:151:18 onsuccess symbol-store-db.js:151 (Async: promise callback) onsuccess symbol-store-db.js:150 (Async: EventHandlerNonNull) _setupDB symbol-store-db.js:141 _setupDB symbol-store-db.js:97 SymbolStoreDB symbol-store-db.js:80 SymbolStore symbol-store.js:172 getSymbolStore receive-profile.js:823 finalizeProfileView receive-profile.js:224 Redux 2 loadProfile receive-profile.js:141 Redux 2 getProfileFromAddon receive-profile.js:807 retrieveProfileFromAddon receive-profile.js:916 Redux 2 getProfilesFromRawUrl receive-profile.js:1409 Redux 2 ``` Here's what is going on in the code: `_setupDB()` calls `const openReq = indexedDB.open(dbName, 2);`. `openReq.onupgradeneeded` is defined, and when run, creates the object store: ``` const store: SymbolStore = db.createObjectStore('symbol-tables', { keyPath: ['debugName', 'breakpadId'], }); ``` `openReq.onsuccess` is then definitely run, which calls `_deleteAllBeforeDate` This error is then generated on: `const transaction = db.transaction('symbol-tables', 'readwrite');` [According to MDN](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore): > [The createObjectStore] method can be called only within a versionchange transaction. We are doing this, then immediately, and synchronously with the onsuccess handler accessing the store. Here's a permalink with valid line numbers: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L97-L154 Plus here is the transaction that is generating the error: https://github.com/firefox-devtools/profiler/blob/715ad6cf908abcb11b068ebe6e01b2f5d238b000/src/profile-logic/symbol-store-db.js#L253