PhilippC / PhilippC/keepass2android

[BUG] write failed, EBADF (bad file descriptor) perpetually on proton drive. Never syncs, still says successful

Open
#2,944 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.2k
Forks
478
Avg merge
1h 4m
Merged PRs (30d)
2

Description

Checks
  • 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce issue #2944 on Keepass2Android 1.12r5 with Android 15 using a database in Proton Drive, and compare the overwrite, merge, and export paths while capturing the EBADF and success messages. Done means the synchronization outcome accurately reflects the write result and the affected Proton Drive workflow has a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.