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

OneDrive shared kdbx file loading fails #387

Open
OculiViridi opened this issue Sep 20, 2024 · 5 comments
Open

OneDrive shared kdbx file loading fails #387

OculiViridi opened this issue Sep 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@OculiViridi
Copy link

OculiViridi commented Sep 20, 2024

Description
I have multiple kdbx files stored on OneDrive premium cloud service and one of them is a shared file from another OneDrive premium cloud service account. The OneDrive share works as excepted, so I see the file and I can download and open it without issues for about a couple of years.
It worked until about a couple of months ago, then someday I started to see the following message below the shared file:

The resource could not be found

As said, the file is ok and it is reachable from everywhere: OneDrive web, OneDrive iOS app, OneDrive PC application, iOS iFile, etc.. I haven't made any change to the share or something.

So, first I tried to remove the file from KeePassium and add it again using the "Connect to server - OneDrive" function. And the strange thing is that the file is correctly taken and loaded into KeePassium the first time, but then, after the first opening, every time I open the app, the error message appears.
So I decided to try to remove and recreate the share for the file from OneDrive, but nothing changed.
Other kdbx files have been loaded into KeePassium the same way using "Connect to server - OneDrive" function and they're not affected by the issue. The only difference is "regular" file vs shared.
The same issue is present on my wife's iPhone with the same KeePassium app version, related to another OneDrive shared kdbx file.

How to reproduce
Steps to reproduce the behavior:

  1. Share a kdbx file from one OneDrive account to another.
  2. Add the shared kdbx file into KeePassium using "Connect to server - OneDrive" function.
  3. Open the db file the first time, everything seems to be ok.
  4. Close the app, reopen it and when syncing, you see the error: The resource could not be found.

Expected behavior
It should works like it was till a couple of months ago, so just like any other kdbx file.

Screenshots
A screenshot of the error message that appears every time I open the app.

20240920_082535763_iOS

Environment:

  • Device: iPhone XS
  • OS: iOS 16.6.1 and iOS 18
  • App Version: 1.52 and 1.53.154
@OculiViridi OculiViridi added the bug Something isn't working label Sep 20, 2024
@keepassium
Copy link
Owner

@OculiViridi , thank you for the report. This is likely a regression after introducing Dropbox and GDrive integration.

Much of the code between the three was the same and was moved to shared classes. I remember some OneDrive parameters (related to shared files) seemed redundant during the process. They were removed and everything continued to work without them — including the shared files. Apparently, they were not that redundant after all…

That said, I struggle to reproduce the error:

  • Is the file owned/hosted by a personal or a business OneDrive account?
  • Is only the file shared or its whole folder?
  • Are you accessing it via a personal or business OneDrive account?
  • Just to confirm, the error shows up immediately after relaunching the app, not after hours/days?

@keepassium keepassium self-assigned this Sep 20, 2024
@OculiViridi
Copy link
Author

  • Is the file owned/hosted by a personal or a business OneDrive account?

In my case they are both OneDrive premium (paid, not free) accounts, but not business.

  • Is only the file shared or its whole folder?

It's a share set on the single kdbx file.

  • Are you accessing it via a personal or business OneDrive account?

Both are accessed via OneDrive personal (but premium/paid) accounts.

  • Just to confirm, the error shows up immediately after relaunching the app, not after hours/days?

I realize now that the description of this aspect wasn't entirely correct, because actually, the message appears immediately after the first time the file is open after the download. When the db is opened, in fact, I already see the message "The database is not reachable. This is the latest local copy." and when I get back to the db list I see the "The resource could not be found." error below the filename.

@keepassium
Copy link
Owner

@OculiViridi , thank you for the details!

I've managed to reproduce the issue with shared files on personal OneDrive accounts. But in my case the error says "ObjectHandle is Invalid", so it looks like a different — although possibly related — problem. There is a good chance that fixing the "object handle" bug would also fix the "resource not found" one as a side effect, but it would be nice to test the fix on both.

These were my steps to replicate the issue:

  • Let Alice and Bob be two OneDrive users with personal accounts. Both are free accounts (the issue remained even after Bob's upgrade later on, so this likely does not matter).
  • Alice's side:
    • She has a shared.kdbx in her OneDrive's standard Documents folder.
    • She right-clicks (in web interface) the file → Share → enters Bob's email and clicks "Send"
  • Bob's side:
    • KeePassium → Connect to Server → OneDrive → proceeds with sign-in
    • He selects Shared folder and selects shared.kdbx there
    • He taps "< Back" to leave the database unlocking dialog and observes "ObjectHandle is Invalid" below the file name.

In general terms, this looks similar to your steps, except the message is different.

I suspect the difference is caused by some detail on Alice's or Bob's side: whether Alice's database is in Documents, or OneDrive root, or some deep subfolder, and whether Bob selects the shared file directly from Shared root, or some folder in there, or even mapped somewhere among his Files (rather than Shared).

Does your procedure look the same as above, or there are some intermediate folders?

@OculiViridi
Copy link
Author

@keepassium

The steps seems to be the same I did.
The share is applied on the single kdbx file that is inside a non-shared folder. -> OK
From KeePassium, the file is picked from the OndeDrive Shared default folder. -> OK

However, there is a small difference, which I don't know if it can influence. The share I created for the file in OneDrive is "read only" type...

@keepassium
Copy link
Owner

@OculiViridi , I've been looking into this for a few hours now, and found a possible workaround.

Try moving the database to a folder and share that folder instead of the file itself. Basically, you should find the file via Connect to Server → One Drive → Shared → Folder name → database.kdbx.

Does this work on your side?

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