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

Repeated saving to Dropbox fails with "No such file" #304

Closed
keepassium opened this issue Aug 15, 2023 · 4 comments
Closed

Repeated saving to Dropbox fails with "No such file" #304

keepassium opened this issue Aug 15, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@keepassium
Copy link
Owner

Description
When a Dropbox-stored database is opened in KeePassium, then edited and saved — the second saving attempt fails with the error "The file … couldn’t be opened because there is no such file."

How to reproduce
Steps to reproduce the behavior:

  1. Open a database stored in Drobox
  2. Add an entry, tap Done, observe the database is saved correctly.
  3. Add another entry, tap Done
  4. Observe an error alert: "The file … couldn’t be opened because there is no such file."

Expected behavior
The database should be saved without errors.

Environment:

  • Device: iPhone 11 (and others)
  • OS: iOS 15.7.7, 16.6, and others
  • KeePassium version: 1.45.138
  • Dropbox version: 340.2.2

Additional context
The issue started in early August 2023, seemingly after Dropbox update to v340.2.2. On device with Dropbox 336.2.2 the issue does not occur.

** Workaround **
The issue does not occur if the database is reloaded after each save. That is, the "open - edit - save - close - open" sequence can be repeated without triggering the error.

Alternatively, you can use the "Save as..." button in the error alert and still save the database to Dropbox. (Both workarounds are admittedly ugly...)

@keepassium keepassium added the bug Something isn't working label Aug 15, 2023
@keepassium keepassium self-assigned this Aug 15, 2023
@keepassium
Copy link
Owner Author

Hmm, this is a tough one… I have tried many variations of the file writing parameters and found only one that seemingly solved the problem: removing file coordination. If the app simply writes to the file without any regard to other app, the database in Dropbox can be written several times without an issue. Not really a fix, but good enough for a quick patch.

As the patch was heading to the App Store, I discovered that file changes are indeed saved to the file, but that file never gets uploaded to Dropbox. Dropbox simply does not detect the file as modified, so all the changes remain in device's local cache. So the problem actually became worse.

Sorry, folks. Patch release postponed, we go back to square one…

@keepassium
Copy link
Owner Author

Finally found out the cause and fixed the issue. Apparently, new Dropbox fails to handle NSFileCoordinator.coordinate() calls that include both the reading and writing intent simultaneously. This is likely their bug but it can be solved on KeePassium's side, too.

The fix is coming with the next update.

@LVladymyr
Copy link

Looks solved case with create-save-edit-save record on v1.46.140 beta.

@keepassium
Copy link
Owner Author

@LVladymyr, thank you for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants