Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing. #398

Closed
bpnolan opened this issue Jun 11, 2020 · 9 comments
Labels
bug db external issue Issue of related third party software

Comments

@bpnolan
Copy link

bpnolan commented Jun 11, 2020

META: SP5.3.4 Electron – en-GB – Linux x86_64 – Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) superProductivity/5.3.4 Chrome/80.0.3987.165 Electron/8.3.0 Safari/537.36

Console Output

Error Log (Desktop only)

Stacktrace

Proxy.transaction (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/node_modules/idb/build/esm/wrap-idb-value.js:150:26)
Proxy.put (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/node_modules/idb/build/esm/index.js:65:25)
t.<anonymous> (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/src/app/core/persistence/database.service.ts:43:26)
Ur (file:///snap/superproductivity/651/resources/app.asar/dist/main.05eca3ac60f95ea85f95.js:1:2007330)
Ur (file:///snap/superproductivity/651/resources/app.asar/dist/main.05eca3ac60f95ea85f95.js:1:2007435)
Ur (file:///snap/superproductivity/651/resources/app.asar/dist/main.05eca3ac60f95ea85f95.js:1:2006173)
t.invoke (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/node_modules/zone.js/dist/zone.js:386:30)
Object.onInvoke (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js:28134:33)
t.invoke (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/node_modules/zone.js/dist/zone.js:385:36)
e.run (file:///snap/superproductivity/651/resources/app.asar/dist/webpack:/node_modules/zone.js/dist/zone.js:143:47)
@johannesjo
Copy link
Owner

Thank you. This can happen if there are two instances of the app running (or some other app accessing it's files). I definitely should improve the error message on though.

@johannesjo
Copy link
Owner

Sorry, I misread the error message. This might be something else:
jensarps/IDBWrapper#80

@johannesjo
Copy link
Owner

May I ask if you encountered this or a similar issue again? I am asking because I had the feeling that this might have gotten better with the most recent electron version (introduced with Super Productivity 5.6.5) as nobody has reported a similar issue after that.

@bpnolan
Copy link
Author

bpnolan commented Sep 28, 2020

Hmm I will leave a comment if I get the issue again. If memory serves I got it a couple weeks ago, nothing since then. Thanks.

@johannesjo
Copy link
Owner

Thank you!

@johannesjo
Copy link
Owner

I added some advanced data repair/restore functionality, as a compromise as there is no way to fix this completely without replacing the database adapter, which is not trivial and likely to cause new issues on other fronts. I think this is acceptable, as the issue only occurs rarely. I am closing this, but please open up new issues, if you encounter this again. Thank you!

@johannesjo
Copy link
Owner

#816

@johannesjo johannesjo added the external issue Issue of related third party software label Aug 29, 2021
@johannesjo
Copy link
Owner

So after all this time, I've been finally able to reproduce the issue. Seems like that this only occurs for the snap version. Haven't found a way to fix it yet. Meanwhile using the deb or the AppImage can be used to avoid the issue.

@johannesjo
Copy link
Owner

johannesjo commented Sep 4, 2021

After digging into this I found out that error appeared whenever snapcraft made one of their automatic backups to the app (which can happen up to 4 times a day if there are updates for the app). Hopefully this is now handled in a more graceful manner.

More information on how to deal with this snap problem can be found here:
https://snapcraft.io/blog/how-to-manage-snap-updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug db external issue Issue of related third party software
Projects
None yet
Development

No branches or pull requests

2 participants