Version: (using KDE 4.3.4) I have been trying to get gpg encryption working. I can save an encrypted file and verify it is correct by running gpg --decrypt against it which asks for the passphrase and decrypts it successfully. However, when I try to open the same file in kmymoney I don't get asked for a passphrase and I just get an error dialog saying the file was not found. Looking at an strace of kmymoney I can see that the file is being found but gpg is complaining about an invalid passphrase. Using gnupg 1.4.9.
This is usually because gpg-agent is running in the background, and perhaps it was set the wrong key. Can you verify that?
Checked and gpg-agent is not running.
I think that the problem is that you don't have pinetry installed. That package contains the dialog used to request your gpg password to decrypt the file. I remember somewhere a request that we should display more useful error messages from gpg in such cases.
Pinentry was not installed. I installed it but kmymoney still doesn't ask for the passphrase.
Is there anything I can do to help debug this? Maybe by putting some debug code in and recompiling? I would need some pointers as to where to look but am willing to give it a try?
(In reply to comment #4) > Pinentry was not installed. I installed it but kmymoney still doesn't ask for > the passphrase. Please check the '~/.gnupg/gpg-agent.conf' configuration file. Look for the entry 'pinentry-program' and check if it's value points to a program that is actually installed.
I do not use gpg-agent. It is not even installed on my system. Anyway, I created the file ~/.gnupg/gpg-agent.conf containing the following line but I am still not being asked for the passphrase. pinentry-program /usr/bin/pinentry-qt
I analyzed this a bit. GpgME requires gpg-agent to be present. I will further investigate what we can do from the application side to specify a better error message.
Just confirming that this has been solved by installing gpg-agent.
SVN commit 1078845 by conet: BUG: 223062 Display the error message from the GPG engine when the problem is in the GPG engine. M +6 -1 kmymoney/views/kmymoneyview.cpp M +12 -7 libkgpgfile/kgpgfile.cpp M +5 -0 libkgpgfile/kgpgfile.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1078845
Just to clarify steps to work around this (in Ubuntu 10.10 at least) after running into this defect myself: 1. install gnupg-agent and pinentry: $ sudo apt-get install pinentry-qt gnupg-agent 2. Reboot (restarting gpg or some other service may work but I didn't know what exactly to restart) I did not have to modify or create the '~/.gnupg/gpg-agent.conf' file. It does not exist at all on my system and kMyMoney now works fine after the above 2 steps. That being said, this defect is marked fixed even though it still occurs. Shouldn't gnupg-agent and pinentry-qt be added as dependencies to kMyMoney if they are required for loading the encrypted files? Given that the encrypted files cannot be recovered if the user deletes their original file, this could be a very big problem for a user if they delete their original file before finding they cannot open the encrypted one and they may not be savvy enough to discover the solution. This is bad behavior on the user's part of course, but people don't always follow logic and in any case they will still be confused and/or frustrated that they are unable to open the encrypted file. I am running kMyMoney 4.5.0 from the Ubuntu repositories.
The proposed dependencies should be handled upstream by the packagers. Once you google for 'recover encrypted kmymoney file' you will be pointed to the solution at https://bugs.kde.org/show_bug.cgi?id=229047.