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

[BUG] KP2A Folder does not work in Microsoft OneDrive #2727

Open
1 task done
chm-von-tla opened this issue Dec 8, 2024 · 10 comments
Open
1 task done

[BUG] KP2A Folder does not work in Microsoft OneDrive #2727

chm-von-tla opened this issue Dec 8, 2024 · 10 comments
Labels

Comments

@chm-von-tla
Copy link

Checks

  • I have read the FAQ section, searched the open issues, and still think this is a new bug.

Describe the bug you encountered:

Both when trying to open a database file and when trying to create a database file the process fails. It seems that this issue bug was present back in 2020 as you can see in #1053 but in the last week 2 users commented as having the same problem as me.

Describe what you expected to happen:

No response

What version of Keepass2Android are you using?

1.11-r0

Which version of Android are you on?

14

@chm-von-tla chm-von-tla added the bug label Dec 8, 2024
@FabianToledo
Copy link

Hello, it is happening to me too.
Synchronization with OneDrive stopped working.
If I try to create a new DB in OneDrive (Keepass2Android App folder) I got a Toast message: "Cannot get path item without share"
I double checked the Apps Permissions in Microsoft.

@garvidev
Copy link

Hello, it is happening to me too. Synchronization with OneDrive stopped working. If I try to create a new DB in OneDrive (Keepass2Android App folder) I got a Toast message: "Cannot get path item without share" I double checked the Apps Permissions in Microsoft.

I have exactly the same problem... I also set up OneDrive for some family and friends and they also have the same problem.

@izi77
Copy link

izi77 commented Dec 17, 2024

I have same issue. I can not sync dB. Error access denied. Any workaroundt how to fix it?

@ikanakova
Copy link

When I had problems with OneDrive in KeePass2Android, it worked well for me to first log in to my MS OneDrive account in the mobile browser and then open the folder with the kdbx file in KeePass2Android.

@izi77
Copy link

izi77 commented Dec 19, 2024

It is no possible now because there is issue to even load file from one drive. Following error occurs:


19/12/2024 18:16:23:936 -- DatabaseSettingsActivity.OnPause 5
19/12/2024 18:16:23:939 -- Timeout start
19/12/2024 18:16:23:958 -- GroupActivity.OnStart 3
19/12/2024 18:16:23:960 -- GroupActivity.OnResume 3
19/12/2024 18:16:23:960 -- DatabaseIsUnlocked=True 3
19/12/2024 18:16:23:961 -- Timeout cancel
19/12/2024 18:16:24:213 -- DatabaseSettingsActivity.OnStop 5
19/12/2024 18:16:24:216 -- DatabaseSettingsActivity.OnDestroyTrue 5


19/12/2024 18:16:26:295 -- status message: Initializing...
19/12/2024 18:16:26:296 -- status submessage: 
19/12/2024 18:16:26:361 -- status message: Synchronizing cached database…
19/12/2024 18:16:26:362 -- status submessage: Loading source file…
19/12/2024 18:16:26:364 -- getPathItem for onedrive2_appfolder://---REMOVED--
19/12/2024 18:16:26:766 -- Status Code: Forbidden
Microsoft.Graph.ServiceException: Code: accessDenied
Message: Access denied
Inner error:
 AdditionalData:
 date: 2024-12-19T17:16:26
 request-id: ********-****-****-****-************
 client-request-id: ********-****-****-****-************
ClientRequestId: ********-****-****-****-************

at Microsoft.Graph.HttpProvider.SendAsync (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x0037b] in <2b78ac00fac54ed593ddfc97204f1ad2>:0
at Microsoft.Graph.BaseRequest.SendRequestAsync (System.Object serializableObject, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x001c6] in <2b78ac00fac54ed593ddfc97204f1ad2>:0
at Microsoft.Graph.BaseRequest.SendStreamRequestAsync (System.Object serializableObject, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x00088] in <2b78ac00fac54ed593ddfc97204f1ad2>:0
at keepass2android.Io.OneDrive2FileStorage`1[OneDrive2PrefixContainerType].OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x0005b] in <4387dcce18dd490eadd43a838bbc0f3d>:0
at keepass2android.Io.OfflineSwitchableFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00006] in <4387dcce18dd490eadd43a838bbc0f3d>:0
at keepass2android.Io.CachingFileStorage.GetRemoteDataAndHash (KeePassLib.Serialization.IOConnectionInfo ioc, System.String& hash) [0x00006] in <4387dcce18dd490eadd43a838bbc0f3d>:0
  at keepass2android.SynchronizeCachedDatabase.Run () [0x0005b] in <4387dcce18dd490eadd43a838bbc0f3d>:0 
19/12/2024 18:16:26:813 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:816 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:817 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:819 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:820 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:821 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:821 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:822 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:823 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:823 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:824 -- Populating group view False ---REMOVED--
19/12/2024 18:16:26:824 -- Populating group view False ---REMOVED--
19/12/2024 18:16:29:272 -- GroupActivity.OnPause 3
19/12/2024 18:16:29:272 -- Timeout start
19/12/2024 18:16:29:287 -- DatabaseSettingsActivity.OnCreate 6
19/12/2024 18:16:29:287 -- DatabaseSettingsActivity:apptask= 6
19/12/2024 18:16:29:320 -- DatabaseSettingsActivity.OnStart 6
19/12/2024 18:16:29:321 -- DatabaseSettingsActivity.OnResume 6
19/12/2024 18:16:29:321 -- DatabaseIsUnlocked=True 6
19/12/2024 18:16:29:321 -- Timeout cancel
19/12/2024 18:16:29:600 -- GroupActivity.OnStop 3


@xtedx
Copy link

xtedx commented Dec 21, 2024

same thing happened to me for a while (not sure exactly from when)
same version 1.11-r0. android 10
i finally found a workaround:

  1. in onedrive, move contents of the Apps/Keepass2Android folder to a new folder
  2. delete the folder Apps/Keepass2Android
  3. go to https://microsoft.com/consent
  4. login and remove keepass2Android's access
  5. in the keeppass2android app, create a new database using the one drive (app folder)
  6. re-authenticate with microsoft and give the permission
  7. use test name at the bottom and click the save button
  8. it should work to create a new database
  9. if you check in onedrive, a new created folder is now Apps/Graph
  10. copy/move the files from step 1 into this new Graph folder
  11. in the keepass2android app, open a new database, and select one drive (app folder)
  12. select your original database from step 1. this time it should work.

now i can sync normally again.

not sure if simply renaming the folder from Keepass2Android to Graph will work. did not have the chance to try as there was no way to guess the name was changed when it created a new db. the point was to create everything from scratch as if there was no one drive access from the beginning.

looking at the logfile from izi77, it seems that there was some API change because the keyword Microsoft.Graph is there, and the default name Graph is used instead of the app's name Keepass2Android

@garvidev
Copy link

same thing happened to me for a while (not sure exactly from when) same version 1.11-r0. android 10 i finally found a workaround:

  1. in onedrive, move contents of the Apps/Keepass2Android folder to a new folder
  2. delete the folder Apps/Keepass2Android
  3. go to https://microsoft.com/consent
  4. login and remove keepass2Android's access
  5. in the keeppass2android app, create a new database using the one drive (app folder)
  6. re-authenticate with microsoft and give the permission
  7. use test name at the bottom and click the save button
  8. it should work to create a new database
  9. if you check in onedrive, a new created folder is now Apps/Graph
  10. copy/move the files from step 1 into this new Graph folder
  11. in the keepass2android app, open a new database, and select one drive (app folder)
  12. select your original database from step 1. this time it should work.

now i can sync normally again.

not sure if simply renaming the folder from Keepass2Android to Graph will work. did not have the chance to try as there was no way to guess the name was changed when it created a new db. the point was to create everything from scratch as if there was no one drive access from the beginning.

looking at the logfile from izi77, it seems that there was some API change because the keyword Microsoft.Graph is there, and the default name Graph is used instead of the app's name Keepass2Android

I tried following these steps... but on step 7, when I tried to save, I got the error "Cannot get path item without share".

@xtedx
Copy link

xtedx commented Dec 21, 2024

I tried following these steps... but on step 7, when I tried to save, I got the error "Cannot get path item without share".

Hmm. I also could not simply create a new database at first.
steps 2-4 was crucial, to make sure there is no trace of keepass2android in onedrive

try to open the "manage access" from the one drive folder and remove it manually for the keepass2android folder? maybe the permission is somehow not removed even if it is deleted from microsoft? but i thought deleting the folder itself will delete this. doesn't hurt trying.

screenshots attached (if onedrive app is installed on windows)
Screenshot 2024-12-21 233800
Screenshot 2024-12-21 233805

if it still doesn't work then i'm not too sure what else to try as i can no longer reproduce this error after my workaround and a new "share" was created with the in the folder "Apps/Graph"

@BrutuZ
Copy link

BrutuZ commented Jan 14, 2025

I've followed all the 12 steps and ended up with the "Cannot get path item without share" toast too.
Microsoft most definitely broke their OneDrive API recently, KP2A was not the only one to suffer from this.

@PhilippC
Copy link
Owner

the current KP2A release is using an old version of the OneDrive SDK which doesn't seem to be supported anymore. I'm working on an implementation with the latest API. Unfortunately, there are many breaking changes between the different versions, so that's more a rewrite than an upgrade 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants