[BUG] write failed, EBADF (bad file descriptor) perpetually on proton drive. Never syncs, still says successful
Checks
- [x] I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:
Every time I try to sync I get a message: "This database file was modified externally, do you want to load and merge the changes before saving"
Then if I select no, overwrite or yes, merge no matter what I get the following error:
Could not save to source file: Write failed: EBADF (bad file descriptor) save again or use the synchronize menu when file is accessible again
This only shows up for 1 or 2 seconds and then immediately after it says "Database Synchronized Successfully"
Obviously this operation finished message is ignoring that the operation failed (it also made it very hard to capture the error).
Overwrite fails, merge fails. Opening and closing the database keeps reverting to the internal copy so I can't abandon whatever is in this database even if I want to.
I synchronize this database across all of my devices to that folder and it's opening and working successfully on all my other devices.
If I try exporting to my proton folder it does save and synchronize successfully so it doesn't seem to be a permissions issue with proton and I can then open that file again on my phone so it's not saving a corrupt/bad export either. Additionally, I can synchronize that export with the proton DB from Keepass on my pc.
If I open another database on my phone and then switch back to my original file it still forces me to use the (bad?) internal cached copy and fails again.
Is there a way to delete that local file? Shouldn't there be a third option to open remote file/don't save local changes? Shouldn't it not say synchronize was successful if there was an error? Why can I export successfully but choosing overwrite still fails?
Describe what you expected to happen:
No response
What version of Keepass2Android are you using?
1.12r5
Which version of Android are you on?
15
I have a really similar issue. I open a database via the "Andriod File Picker" then choose my Proton Drive and open the file. If I make a change I cannot ever save the database. However, as per @tastyratz if I export the database and save it in the Proton Drive, it works just fine.
I appreciate that Proton users are probably niche, so please do tag me if you fix it.
Been getting the same issue with Proton
Well, this problem is 2 fold.
-
Why is this happening with Proton (and potentially other destinations?)
-
How do we resolve the broken internally cached database in this or similar scenarios? Where is this saved?
I believe the root of the problem here is "what happens when the internal database cached copy goes wrong". It not only breaks, it becomes unrecoverable. Renaming the database elsewhere is just... creating a fresh cached copy.
just to reiterate that I am experiencing the same issue with ProtonDrive.
@proton-ci you guys probably should be aware of this too.
Exactly the same message/issue here, when trying to open or to create a database in my local BOX storage (cloud storage from box.com)
Same message/issue here.
Same message/issue here. Version 1.14-r1
I just started using proton drive and I see same issue. I have tried with keepassDx, and I get Cannot save database. So most likely android proton drive issue?
I reached out to proton drive android team regarding this issue, and got response from them. The issue isn't related ot keepass2android any android keepass app, it's more to do how proton drive downlaod files. here is their response
We would like to clarify that, currently, due to limitations in our Proton Drive Android application, KeePass database files cannot be directly backed up or synchronized to Proton Drive.
This limitation stems from the way downloaded files are handled on the current version: when files are downloaded from Proton Drive, they are stored in the app's internal cache memory, they are encrypted at rest, and they do not have a normal file path. This also means that third-party applications, like KeePassXC, cannot access or edit these files directly.
Essentially, this is what leads to the requirement of having to create a copy outside of Proton Drive and then re-upload it if you need to make any edits.
To this end, we've already forwarded your feature request to our development team to explore the possibility of supporting direct interactions with KeePass databases in future updates. While we are actively working on enhancing our services based on user feedback, we unfortunately cannot provide a specific timeline for if or when this feature will be implemented.