Ubuntu 20.04
KeePassXC umounts Google Drive folder while trying to save converted database file on it.
Then opens read-only the database file stored on Google Drive folder.
I'm trying to move to keepassxc from keepass 1
My database is stored on Google Drive. I access it using the Ubuntu standard tool which utilizes Nautilus file manager. Thus Google Drive is seen as a mounted network disk.
Having the database file stored on a local folder or on a mounted network disk should not be different for KeePassXC
The Google Drive network disk is not properly managed
KeePassXC - Version 2.4.3
Revision: 5d6ef0c
Operating System: Linux Ubuntu 20.04
Desktop Env: Gnome
Windowing System: X11
We are not mounting or unmounting anything.
Well maybe Nautilus unmounts Google Drive as a result of improper action by keepassxc
I realized version 2.4.3 from the ubuntu repository is not the latest. I installed version 2.5.4 from ppa:phoerious
The behaviour remains exactly the same :-(
The opening of a file as read only is fixed in 2.6.0. Try our beta build.
Well now the database file is saved on google drive but the original file name is lost. It is stored with something that looks like a temporary name: 1BdtRu8yCTCMjJW1O4knX74O0L0mUMeek
Ummm that's unique!
I tried that:
1- open the "strange name" file
2- save database as "new file name" on a local folder
3- open "new file name"
4- save database as same "new file name" on google drive
Saving fails and google drive is unmounted :-(
Do you have safe file saves enabled? We don't do much outside of standard Qt file calls. Does any other app have trouble with the Google drive mount?
With "safe file saves" enabled I get the unmount problem when saving a new file. Without it I get files saved with the strange temporary name.
I don't have troubles with other apps. I.e. I noticed that when libreoffice edits a google drive file a temporary file name is shown on its window top (that does not happen with a local file). Nonetheless then the file is saved correctly with its name on google drive.
So I just tried replicating this on Ubuntu 20.04, using standard Google account features in Gnome. When I tried saving a database to the GVFS mount, GVFS crashed. This is probably why you are seeing it unmount/mount again. It crashed with a null pointer error. This is clearly a bug in GVFS when using QSaveFile type operations. QSaveFile works by writing to a temporary file next to the real file, deleting the real file, then renaming the temporary file as the real file name.
Here are the results of my testing:
Safe Saves ENABLED:
Safe Saves DISABLED:
Thank you very much droidmonkey! You pointed very well the problem. But I wouldn't be so sure about a bug in GVFS. Just because other apps that open and save files to GVFS mount point don't have the same problem. You can try and see.
Under no circumstances should it be possible to crash GVFS. That is a bug.
Well, I see your point, I will try to open a bug under gitlab.gnome.org
But the "saving an existing database" problems still stands
The problem is that Qt receives the file name as something like /run/user/1000/gvfs/google-drive:host=.../1BdtRu8yCTCMjJW1O4knX74O0L0mUMeek instead of google-drive://passwords.kdbx. So when the database is saved that is the file path that is used. Which is why that crazy long name is used, btw.
That crazy long name is just the temporary file name. KeePassXC should not use that name but save the file with its original file name. I guess for example Libreoffice does it that way since it shows the crazy long name while editing but uses the original name when saving. You can test and see
I have no idea how to get the original file name, it does not appear when choosing the file at all. Regardless, that shouldn't be our responsibility, we are technically saving to the temporary file and GVFS needs to do the translation for us. Perhaps because of the manner in which we save files it is getting confused. We do not save directly to the existing file, we write a temporary file, delete the original, and move a new file to where the original file was.
Can't you try to avoid deleting the original file? And close by saving the temporary file onto the original?
It looks like I have to give up using KeePassXC because of its incompatibility with Google Drive on Linux :-(
(Edited for formatting)
Hello,
I am having exactly the same issue as blasco51, using what appears to be the same setup (details below) of Ubuntu 20.04 and KPXC 2.6.0.
Using 2.4.3 under Ubuntu 19.04, this was never a problem, and safe saving worked, preserving the filename. Is the above thread an indication that this is purely a GVFS issue in Ubuntu 20.04?
Saving a database should preserve the original filename.
The filename is changed after every save.
Fresh installation of Ubuntu 20.04
KeePassXC 2.6.0 installed from https://launchpad.net/~phoerious/+archive/ubuntu/keepassxc (repo was added to my sources to keep updating)
Syncing to Google Drive via native Ubuntu Online Accounts service, GVFS via Nautilus file manager
KeePassXC - Version 2.6.0
Revision: 0765954
Qt 5.12.8
Debugging mode is disabled.
Operating system: Ubuntu 20.04 LTS
CPU architecture: x86_64
Kernel: linux 5.4.0-40-generic
Enabled extensions:
Cryptographic libraries:
libgcrypt 1.8.5
Operating System: Linux/Ubuntu 20.04
Desktop Env: Gnome
Windowing System: Xorg
I'm surprised this worked for you at all in 2.4.3 because it should have opened the database read only.
This also is a huge problem for me and how I accidentally lost my main passwords file (now I use a crontab and "drive" for linux to pull them hourly). This is the only app I this issue with. Gnome + System 76 Pop!_OS.
For now, I am using grive instead (there are others of course at https://www.ubuntupit.com/top-12-best-google-drive-linux-client-software/) to sync files. Hope this gets fixed so I can use the built-in gvfs support in Gnome 3.
I'm surprised this worked for you at all in 2.4.3 because it should have opened the database read only.
I'm very sorry, my mistake - I think it might have been 2.4.1 that saved correctly. I neglected to make a note of the version I was using more successfully before I upgraded my OS and then installed 2.6.0.
Just adding +1, I also encounter this problem.