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

Could not save database with PCloud #788

Closed
undecomposed opened this issue Nov 18, 2020 · 21 comments
Closed

Could not save database with PCloud #788

undecomposed opened this issue Nov 18, 2020 · 21 comments
Labels
bug FileSync Linked to FileSync app out of scope

Comments

@undecomposed
Copy link

Describe the bug
On Android 10, when opening database from a third-party application using the file picker, any attempt to edit database entries or create database entries results in an Could not save database error.

To Reproduce
Steps to reproduce the behavior:

  1. Open KeePassDX.
  2. Click Open existing database
  3. In the file picker, click the hamburger menu.
  4. Scroll to the bottom of the menu.
  5. Click the application to select the file from (pCloud in my instance).
  6. Click the KeePass database.
  7. Enter the decryption details (just the password in my case).
  8. Tap Open.
  9. Click the plus button at the bottom right corner of the screen.
  10. Tap Add entry.
  11. Set the Title field as test.
  12. Tap the checkmark button at the bottom of the screen to save changes.

Expected behavior
The new entry is saved successfully.

** Keepass Database **

  • Created with: Windows KeePass 4.46.
  • Version: 2
  • Location: pCloud.
  • Size: 3.7 MB
  • Contains attachment: Yes

KeePassDX (please complete the following information):

  • Version: 2.9.1
  • Build: Free
  • Language: English.

Android (please complete the following information):

  • Device: OnePlus 6T
  • Version: 10.3.6

Additional context
Add any other context about the problem here.

  • Browser for Autofill: Microsoft Edge.
@J-Jamet
Copy link
Member

J-Jamet commented Nov 18, 2020

The problem comes from the content-provider of the file manager application (here PCloud).
It seems that PCloud does not open the URI for writing but only for reading only when a write request is asked by KeePassDX.
I will test but I don't think I can do better, you have to ask PCloud to change this behavior.

@J-Jamet J-Jamet changed the title "Could not save database" Could not save database with PCloud Nov 18, 2020
@J-Jamet
Copy link
Member

J-Jamet commented Nov 18, 2020

I just tested and indeed, the behavior of PCloud is not as expected. So I advise you to download the file from PCloud, modify it from the Download folder and then re-download it in PCloud once the changes have been made. I write the note in the wiki.

@stingray21
Copy link

I understand that it's not because of KeepassDX that this does not work and that file sharing is not in the scope of this project, but it would be great to find a solution. Having European hosted and encrypted file sharing to sync the database would be really nice.

I could try reaching out to pCloud, if you could provide a little more information what the exact problem is.

@undecomposed
Copy link
Author

My understanding was that pCloud was allowing external applications to get a file in read only mode.

@alensiljak
Copy link

If simply looking for a solution, there are at least two:

  1. Synchronise with rclone,
  2. Use KeePass2Android

@J-Jamet
Copy link
Member

J-Jamet commented Jan 2, 2021

  1. Contact PCloud to change the behavior of their app
  2. Create a file manager that uses their API
  3. Download the file from PCloud to modify it and re-upload it when you are done

@undecomposed
Copy link
Author

If simply looking for a solution, there are at least two:

  1. Synchronise with rclone,
  2. Use KeePass2Android

Unfortunately, KeePass2Android has the same issue

@alensiljak
Copy link

No, it doesn't. It supports WebDAV and has been working beautifully for years.
Recently the pCloud support has been fixed, apparently, but I haven't tried it.

@J-Jamet
Copy link
Member

J-Jamet commented Jan 10, 2021

KeePass2Android directly integrates the Pcloud API, which I don't want for several reasons that I mentioned here and in the wiki.

If PCloud knowingly blocks requests to open files for writing, it's to use their API. This is a method I deplore and I won't play this game, I want KeePassDX to remain an editor not a code aggregator for external file manager.
It's horrible maintenance to add each new trendy API, just to find a workaround because the company doesn't implement its content provider correctly.
It would be enough to allocate writing to not have to manage the complete maintenance of an API.

KeePass2Android integrates them, but not KeePassDX for good reasons, we just don't have the same way of seeing things, and that's why I made this app.
Afterwards, people use the tools they obviously want, but I personally wish to keep the philosophy of free software in the creation of the architecture and not be subjected to each new company or fashionable protocol that appears. (maybe my French side)
KeePass and KeePassXC on PC don't have to embed Cloud APIs in their code, I don't see why derivatives on phones should when there are documented, secure and official solutions provided by Android (storage access framework).

I will maybe do an external file manager with these APIs with plugins but I'd rather devote myself to important issues than finding workarounds for companies that block the functionality of their apps.

@alensiljak
Copy link

Just FYI, WebDAV is not a "fashionable protocol". It's been around for 24 years.

@J-Jamet
Copy link
Member

J-Jamet commented Jan 10, 2021

I have nothing against WebDAV, on the contrary, it is a good protocol. But I want to keep the principle of encapsulation., it is a protocol for information transfer that requires internet (and internet permission). KeePassDX is only a file editor and not a file manager, WebDAV must be integrated in a file manager, that's all.

@J-Jamet
Copy link
Member

J-Jamet commented Jan 10, 2021

Everybody wants WebDAV and Cloud integration, which I understand very well, it just takes time to create a correct file manager that manages the protocol with a content provider. It is not a lasting solution to provide a strong link between the two concepts in a single application when it would give much more advantages to separate them and do this in a dedicated app.

@stingray21
Copy link

I contacted pcloud about this issues. I wrote "KeepassDX" in my email and even liked to this issue, so I am not sure if it is a mix-up or typo that they wrote Keepass (with DX) in their reply.
This is what they wrote:
As far as we know KeePass did not implement their apps to work with our EU data region accounts, since we have that issue since then with their app. We confirm that the issue is not on our end.

@J-Jamet
Copy link
Member

J-Jamet commented Mar 24, 2021

I don't see the connection with the European region at all... If their PCloud application doesn't work with European accounts it has nothing to do with KeePassDX, they just have to fix their servers.

It must be a generic support answer that doesn't bother to look at the content provider of their app. But it is in their interest to avoid the question, they want us to integrate their API in our app.
Nice try though. ;)

@stingray21
Copy link

I am not an expert at all on this topic, but I set up Joplin to sync with pCloud via webdav. There you have to use different urls depending on the region, i.e. https://webdav.pcloud.com and https://ewebdav.pcloud.com (with the additional e) for European account. Could something like that be the reason why the region matters?
(If you have an account with pCloud you can choose whether you want to use their US or European server.)

@J-Jamet
Copy link
Member

J-Jamet commented Mar 26, 2021

Joplin must integrate the corresponding API directly into their code, it is indicated on their website.
If there is a European region account problem it is either a problem of their API (which is not in KeePassDX) or of their PCloud application (which must also contain their API).
It has nothing to do with KeePassDX, here we are only concerned with the content provider of the PCloud application that provides the data streams of the files, no matter how they provide them, it is their concern.

@stingray21
Copy link

stingray21 commented Mar 30, 2021

I replied to their last response, this is what they said:

Since KeepassDX is a third party application, it hasn't been tested with pCloud. Sometimes files can not be edited when in the pCloud app so you have to download them locally, edit and upload the new file to pCloud.

Which is basically point 5) for your list above ;)

If you have more details already available on what specifically PCloud needs to change about the behavior of their app , I am happy to follow up with them. They seem to be pretty responsive.
But if this would take a lot of work and time for you, just forget about it :) I'm already very pleased and grateful for what you did so far.

I can also try helping in other ways to make it work, if you could point me towards where to start :)

@J-Jamet
Copy link
Member

J-Jamet commented Mar 30, 2021

Thank you for your investment, it is appreciated.

If you have more details already available on what specifically PCloud needs to change about the behavior of their app , I am happy to follow up with them

I don't know what they need to change, the PCloud app is not open source.
And even more important, it's not up to me, a freelancer working on his own time, to give courses to a big company.
There is Android documentation, it's not so hard to find. ;)
https://developer.android.com/guide/topics/providers/create-document-provider

I will look at the subject later when making the new separate file manager application dedicated to KeePassDX.

@stingray21
Copy link

Thank you!

I will try looking more into it and learning more about it.

Let me know if I can help with anything specifically.

@J-Jamet J-Jamet added FileSync Linked to FileSync app and removed wontfix labels Jan 21, 2022
@J-Jamet
Copy link
Member

J-Jamet commented Feb 19, 2022

As this issue is linked to an external API, I close this issue, you can continue to discuss on the FileSync application dedicated to file synchronization. Kunzisoft/FileSync#6

@gilbsgilbs
Copy link

I suspect this issue was fixed in d217b52. You may want to try with KeePassDX 3.4.0+ to see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug FileSync Linked to FileSync app out of scope
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants