keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

[BUG] OneDrive sync integration no longer working after 1.12-r5

Open TDaugh opened this issue 11 months ago • 4 comments

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:

I am unable to sync with OneDrive anymore. I am unsure of the original error but I'd been syncing with OneDrive for quite a while without issue. The recent update of KP2A caused the sync to stop working with error messages, so I performed the following:

  • Uninstalled and reinstalled the KP2A app. When accessing the KP2A folder via OneDrive, the sign-in was successful, but I was just met with an "empty" file list, despite the DB file existing in the same folder.
  • Attempted to create a new database on the OneDrive KP2A folder option. When I do this, name the file, and hit save, it goes back to the previous screen without error, but I can see it's still trying to create a local file on Android, not OneDrive.
  • Removed KP2A's access to my OneDrive, and deleted the folder and DB, then tried to create again. I was walked through agreeing to the permissions again, but the result was the same, it came back to show it was going to create a local file, no errors. It did not create the folder on OneDrive.

Describe what you expected to happen:

The OneDrive KP2A folder option should allow access to existing DBs in that folder for sync, as well as creation of new DBs.

What version of Keepass2Android are you using?

1.12-r5

Which version of Android are you on?

Android 15

TDaugh avatar May 28 '25 15:05 TDaugh

Hi I had the same issue on the same version. The error message says: Could not access source file: you have opened your file through deprecated Microsoft API. ...

The error message disappears quite quickly, so it's hard to read, but it also tells you to re-open the file from onedrive. Doing that fixed the problem for me.

RafaShobr avatar May 28 '25 19:05 RafaShobr

Thank you, though that was one of the things I'd already tried. It just show's empty on the file selector.

TDaugh avatar May 28 '25 20:05 TDaugh

It seems like there is an issue with the App-folder implementation in 1.12-r5. If you can accept to grant full access (temporarily), it might work. I'll try to fix this, of course, anyway.

PhilippC avatar Jun 03 '25 07:06 PhilippC

@TDaugh I tried reproducing the issue but I can't. It works for me on both personal and business accounts.

You could try to revoke any app permissions granted for Keepass2Android on https://myapplications.microsoft.com/ (business accounts) or https://account.live.com/consent/Manage (personal accounts) and try again. If it still doesn't work, please enable debug logging in the app. Then reproduce the problem and then post the log here.

PhilippC avatar Jun 17 '25 13:06 PhilippC

Thanks, unfortunately I had tried removing those permissions already and allowed KP2A to recreate them. The logs appear to still show a permission denied error. I am using personal OneDrive.

Here are the debug logs. kp2a debug 20250617.txt

Thanks for your help on this.

TDaugh avatar Jun 20 '25 13:06 TDaugh

Hi I’m encountering the same problem in Keepass2Android. When trying to open my shared KeePass database via OneDrive this message appears:

“you have opened your file through a deprecated Microsoft API”

This happens when I open the file directly within the app’s OneDrive integration, but not when I:

  1. Sync the .kdbx file using the official OneDrive Android app.
  2. Open it via “Open with → Keepass2Android” from the OneDrive app, which then uses the Android system file picker.

In short: opening through the OneDrive app and then sharing to KeePass2Android avoids the error, but opening via the in‑app OneDrive API triggers the deprecation warning :contentReference[oaicite:1]{index=1}.

Suggested workaround for other users: Use the system file picker rather than the in‑app OneDrive integration.

Thanks a lot for your work on this app!

moonClimber avatar Jun 28 '25 16:06 moonClimber

@moonClimber @RafaShobr Your message is different from what @TDaugh reported. If you see the deprecation error, you can still use the built-in integration when doing Open database => OneDrive (or updating AutoOpen entries if it's related to that).

PhilippC avatar Jun 30 '25 07:06 PhilippC

Hello @PhilippC , do I understand correctly that the bug has been fixed? When will the fixed version be available on Google Play? Thank you!

ctvrta avatar Aug 19 '25 16:08 ctvrta

I cannot guarantee that the fix works but I have reason to believe so :-) Please test it with https://github.com/PhilippC/keepass2android/releases/tag/v1.14-pre3.

PhilippC avatar Aug 20 '25 04:08 PhilippC