Bug 332409

Summary: Sync of password store with harddisk failed: RC -7 SF Unknown error - encryption error when saving password store: Errorcode 1 (Unknown error)
Product: [Applications] kwalletmanager Reporter: Dennis Schridde <heri+kde>
Component: generalAssignee: Valentin Rusu <valir>
Status: RESOLVED NOT A BUG    
Severity: normal CC: 222.222.ffffffff, jorohr, Stephan
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Dennis Schridde 2014-03-21 16:42:43 UTC
A short while after KWallet starts, or whenever I close it manually, it will present a dialogue box with roughly following content:
~"Encryption error when saving password store. Errorcode 1 (Unknown error)"

The exact message is German:
"Verschlüsselungsfehler beim Versuch den Passwortspeicher zu speichern kdewallet. Der Fehlercode lautet 1 (General error). Bitte korrigieren Sie Ihre Systemeinrichtung und versuchen es dann erneut."

The notification area also logs a message, which reads roughly as follows:
~"Sync of password store with harddisk failed: RC -7 SF Unknown error"

The original message is German:
"Abgleich des Passwortspeichers kdewallet mit der Festplatte ist fehlgeschlagen. Die Fehlermeldung lautet RC -7 SF Unbekannter Fehler. Bitte senden Sie einen Fehlerbericht mit diesen Informationen an bugs.kde.org"

After a while another dialogue pops up:
~"Closing the password store cannot be enforced. Errorcode: -1"

German:
"Das Schließen des Passwortspeichers lässt sich nicht erzwingen. Fehlercode: -1"

Enabling debugging with kdebugdialog logs the following to ~/.xsession-errors:
kwalletd(1903)/kdeui (Wallet) kdemain: kwalletd started
kwalletd(1903)/kdeui (Wallet) KWalletD::connectToScreenSaver: connected to screen saver service.
kwalletd(1903) KWallet::GpgPersistHandler::read: This wallet was encrypted using GPG key with ID  "XXX"
kwalletd(1903) KWallet::GpgPersistHandler::read: The key was found.kwalletd(1903) KWallet::GpgPersistHandler::write: GpgME encryption error:  1

I am running Gentoo/Linux and use following software versions (category/package-version[useflags]):
kde-base/kwalletd-4.12.3[semantic-desktop]
app-crypt/gnupg-2.0.22[bzip2 ldap nls readline smartcard usb]
app-crypt/gpgme-1.4.3[]

The problem probably appeared after updating KDE to 4.12.3 (hard to say, because I used this machine very very seldomly recently).

Reproducible: Always
Comment 1 Valentin Rusu 2014-04-01 21:27:45 UTC
Does your gpg set-up is OK on your system? Are you able to encrypt then decrypt a test file using the key you used to set-up your wallet ? Is that key "ultimate trusted" ?
Comment 2 Christoph Feck 2014-04-20 20:41:10 UTC
If you can provide the information requested in comment #1, please add it.
Comment 3 Dennis Schridde 2014-04-21 02:38:57 UTC
For the next few months I do not have access to the mentioned machine. I will come back to you afterwards.
Comment 4 Johannes Rohr 2015-06-01 09:14:10 UTC
Hi there, I am on Arch Linux, I yesterday installed plasma and kde-applications, and I am seeing the same here. I what could be related is, that after I migrated kwallet to GPG, I later created a newer GPG key. KWalletmanager still uses the old key. Whatever the reason, the problem is, that Kwalletmanager fails to reveal any details about what is actually going on and Kwalletmanager seems to lack the functionality to migrate the password store from one key to another.
Comment 5 Johannes Rohr 2015-06-01 11:27:59 UTC
I think I have found the reason: I had to change the key trust settings in Kleopatra for my GPG key. Obviously, Kleopatra was unaware, that this particular key is my own and therefore has implicit ultimate trust.
Comment 6 Valentin Rusu 2015-06-01 21:45:08 UTC
(In reply to Johannes Rohr from comment #4)
> Hi there, I am on Arch Linux, I yesterday installed plasma and
> kde-applications, and I am seeing the same here. I what could be related is,
> that after I migrated kwallet to GPG, I later created a newer GPG key.
> KWalletmanager still uses the old key. Whatever the reason, the problem is,
> that Kwalletmanager fails to reveal any details about what is actually going
> on and Kwalletmanager seems to lack the functionality to migrate the
> password store from one key to another.

I just filed an enhancement request for this - see BUG 348560. I'll take care of it asap.
Comment 7 Valentin Rusu 2015-06-01 21:47:12 UTC
Indeed, the key must to be "ultimate trust" in order to successfully handle the encryption. So, this is not really a bug, so closing it.