Bug 381910

Summary: New user: Starting kleopatra shows 'loading certificate cache ...' forever
Product: [Applications] kleopatra Reporter: Achim Bohnet <ach>
Component: generalAssignee: Andre Heinecke <aheinecke>
Status: RESOLVED FIXED    
Severity: normal CC: brunocraig, jat255, kdepim-bugs, mavaddat.javid, mutz, nonamecrew00
Priority: NOR    
Version: 2.3.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
URL: https://bugs.kde.org/show_bug.cgi?id=381910
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot of never ending 'loading ...

Description Achim Bohnet 2017-07-02 14:29:09 UTC
Created attachment 106416 [details]
screenshot of never ending 'loading ...

For tests I've created a new user installed kmail & kleopatra.  Started kmail
then kleopatra and kleopatra displayed over the empty key list.

 Loading certificate cache ...  + an animated progress bar

(see attached screenshot).

Bug: even after 30 min the 'loading' is not still not finished

Expected result:  Msg and progress bar disappear when loading is finished.

Achim
Comment 1 Andre Heinecke 2017-09-08 08:09:02 UTC
What Kleopatra does internaly is basically a
gpg2 -K

and
gpgsm -K

on the command line. Can you please try to reproduce the hang on the command line. Then we could report this upstream. A likely cause for this might be a hanging gpg-agent. There were some bugs fixed upstream in that area. The standard Ubuntu Xenial gpg2 is pretty broken, though so it might have already been fixed upstream.
Comment 2 jat255 2017-09-13 20:55:06 UTC
I am affected by this bug as well on Arch Linux (fully up-to-date). Trying to list secret keys with both of those gpg commands causes a hang on my system too.
Comment 3 jat255 2017-09-13 21:04:13 UTC
More details on system and packages:

Linux hostname 4.12.8-2-ARCH #1 SMP PREEMPT Fri Aug 18 14:08:02 UTC 2017 x86_64 GNU/Linux

gnupg 2.2.0-1
kleopatra 17.08.1-1
Comment 4 jat255 2017-09-17 21:22:04 UTC
After deleting ~/.gnupg and uninstalling/reinstalling GnuPG, this seems to be working now. Not sure what caused it to get hosed up.
Comment 5 jat255 2017-09-21 16:25:05 UTC
I spoke too soon. After another couple days, same problem...
Comment 6 Andre Heinecke 2017-11-10 08:30:47 UTC
If the commands mentioned in comment 1 hang it's a downstream issue. If gpg -K hangs we can't do much in Kleopatra to fix this.

Please report this under https://dev.gnupg.org

You may try to get more verbose output of gnupg or gpg-agent by adding debug options to the commands.
Comment 7 Andre Heinecke 2017-11-13 07:29:36 UTC
*** Bug 386378 has been marked as a duplicate of this bug. ***
Comment 8 Andre Heinecke 2017-11-13 07:32:44 UTC
*** Bug 386789 has been marked as a duplicate of this bug. ***
Comment 9 Andre Heinecke 2017-11-13 07:36:20 UTC
*** Bug 385994 has been marked as a duplicate of this bug. ***
Comment 10 Andre Heinecke 2017-11-13 08:01:45 UTC
Git commit 0be82c93b7c046669320aaded25cde7435c6d033 by Andre Heinecke.
Committed on 13/11/2017 at 08:00.
Pushed by aheinecke into branch 'master'.

Fix potential race hiding keycacheoverlay

There might be an issue that the keycache is filled before
the signal is properly connected. To be robust this adds
a watchdog to check if the keycache is initialized.

This mainly a safeguard. The problem reported in the
Bug appears to be a GnuPG problem as kleopatra would
show keys in the background if the keycache was filled.

M  +15   -1    src/view/keycacheoverlay.cpp
M  +2    -0    src/view/keycacheoverlay.h

https://commits.kde.org/kleopatra/0be82c93b7c046669320aaded25cde7435c6d033
Comment 11 Andre Heinecke 2017-11-13 09:40:16 UTC
For windows this might be  https://bugs.kde.org/show_bug.cgi?id=381910 

For Ubuntu / Neon this might have been other bugs that were fixed since 2.1.11 is quite outdated and broken.
Comment 12 Achim Bohnet 2018-01-05 16:17:07 UTC
I can't reproduce anymore on KDE Neon User (based on ubuntu 16.04):

gpg -K and gpgsm -K do not hang.  Their version (2.1.11-6ubuntu2) is still the as at the time I reported the bug, but kleopatra was updated from 2.3 to now 3.0.1.


It also works on Kubuntu 17.10 (artful artvaard):

It has gpg(sm) 2.1.15. gpg -K and gpgsm -K do not hang. kleopatra is 2.3 (KDE apps 17.04)


So maybe your fix made kleopatra work with old buggy gpg 2.1.11 and newer gpg 2.1.15 works even with old kleopatra 2.3.

Thx!
Comment 13 Andre Heinecke 2018-01-08 06:45:04 UTC
Thanks for your test.