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

Uncaught Error: EBUSY: resource busy or locked, unlink offline.sqlite #5063

Closed
ganthern opened this issue Jan 30, 2023 · 4 comments · Fixed by #6541
Closed

Uncaught Error: EBUSY: resource busy or locked, unlink offline.sqlite #5063

ganthern opened this issue Jan 30, 2023 · 4 comments · Fixed by #6541
Labels
bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues state:done meets our definition of done topic:offline issues with the offline database of the native clients
Milestone

Comments

@ganthern
Copy link
Contributor

ganthern commented Jan 30, 2023

Started in 3.108.10: No, has been a thing for longer, but is probably amplified by our more aggressive odb deletion policy.

Client: win32
Type: FREE
Tutanota version: 3.108.10
Timestamp (UTC): Mon, 30 Jan 2023 14:02:10 GMT
User agent:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) tutanota-desktop/3.108.10 Chrome/108.0.5359.179 Electron/22.0.3 Safari/537.36
Error
Error message: EBUSY: resource busy or locked, unlink 'C:\Users\pfft\AppData\Roaming\tutanota-desktop\offline_NEm-M6k----9.sqlite'
Stacktrace:
Error: EBUSY: resource busy or locked, unlink 'C:\Users\pfft\AppData\Roaming\tutanota-desktop\offline_NEm-M6k----9.sqlite'

Workaround

Delete saved credentials & log back in.

@ganthern ganthern added bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues topic:offline issues with the offline database of the native clients labels Jan 30, 2023
@ganthern
Copy link
Contributor Author

ganthern commented Feb 2, 2023

We've decided to fix the issue that causes the client to repeatedly recreate the db (#5044) and attach logs to the error reports (#5049) to get insight into this one, because we can't figure out why we're still (or again) holding a handle to the sqlite file when we try to delete it.

@ganthern
Copy link
Contributor Author

Still happens a lot, I expect that it has something to do with

  • having a single-user installation and updating to all-users or the other way around.
  • having two instances of the app running (maybe compounded by the above). Some user that had this several times assures us there's only one running though.

@bedhub
Copy link
Contributor

bedhub commented Jun 16, 2023

User comment that might be helpful to reproduce the case:

"Error occurred when changing the password within Desktop client from"

@charlag
Copy link
Contributor

charlag commented Feb 12, 2024

We should try reproducing the scenario with both user & global versions running at the same time.

  1. Install app as a user-only
  2. Receive an update and select global install
  3. See if the error is shown on login

charlag added a commit that referenced this issue Feb 13, 2024
Previously when the database initialization failed (e.g. due to
mismatching key) we would not close it but would try to simply delete
it. Windows was disallowing it due to the file lock and the app would
get stuck with a database that is not opened nor can be deleted.

Now we make sure to close the database if initialization fails.
Additionally, we proceed with closing the database if vacuuming fails
during the normal database closing so it doesn't prevent us from closing
the database. This is not needed to fix the issue at hand but hopefully
improves the reliability

fix #5063
@mpfau mpfau added this to the 3.122.5 milestone Feb 13, 2024
mpfau pushed a commit that referenced this issue Feb 13, 2024
Previously when the database initialization failed (e.g. due to
mismatching key) we would not close it but would try to simply delete
it. Windows was disallowing it due to the file lock and the app would
get stuck with a database that is not opened nor can be deleted.

Now we make sure to close the database if initialization fails.
Additionally, we proceed with closing the database if vacuuming fails
during the normal database closing so it doesn't prevent us from closing
the database. This is not needed to fix the issue at hand but hopefully
improves the reliability

fix #5063
@wrdhub wrdhub added the state:done meets our definition of done label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug broken functionality, usability problems, unexpected errors desktop Desktop client related issues state:done meets our definition of done topic:offline issues with the offline database of the native clients
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants