Bug 396016

Summary: KMYMoney GPG option is grayed out even though GPG installed
Product: [Applications] kmymoney Reporter: Greg Greg <greg_sitbon>
Component: fileAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: nhaines, ralf.habacker, veperr-kdebug
Priority: NOR    
Version: 4.8.2   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
See Also: https://bugs.kde.org/show_bug.cgi?id=435761
Latest Commit: Version Fixed In: 5.1.2
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 426400    
Attachments: screenshot of the grayed out menu
Screenshot 2021-10-14 020806.png
Screenshot 2021-10-14 021136.png
kmymoney test file
Screenshot 2021-10-14 164928.png
2021_10_16 CMD trace
Screenshot showing KDE related processes
Screenshot of processes
2021_10_29 CMD trace

Description Greg Greg 2018-06-30 11:26:20 UTC
Created attachment 113657 [details]
screenshot of the grayed out menu

Hello,
I used to use the GPG options and was happy with it.
Unfortunatelly, I had a new computer installed.
I installed Kleopatra with all the options I was using before.
Unfortunatelly, the option to encrypt file "Use GPG Encryption" is grayed out.
I would like to investigate but don't know where to start.
May you please?
Thank you
Greg Greg
Comment 1 Greg Greg 2018-06-30 11:27:12 UTC
I forgot to mention I am using Windows 10
Comment 2 Ralf Habacker 2021-04-15 09:40:23 UTC
By default gpg will only available in kmymoney, after at least one gpg key has been generated or imported.

Unfortunately, kmymoney does not give any hint about this special case in the user interface, which would give the user the possibility to fix this problem himself with the command `gpg2 --gen-key` on the command line.
Comment 3 Ralf Habacker 2021-04-15 09:41:14 UTC
This issue also affects the version 5 releases.
Comment 4 Bug Janitor Service 2021-04-15 12:47:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/74
Comment 5 Ralf Habacker 2021-04-18 07:18:34 UTC
Git commit b4d06aef8b54fad9e2704e3e28fd4b70734ee40e by Ralf Habacker.
Committed on 18/04/2021 at 07:01.
Pushed by habacker into branch '5.1'.

Show tooltip in xml storage settings dialog when GPG is not working

In case GPG is not installed or no GPG secret keys are available a
corresponding hint is displayed in the mentioned dialog so that the
user can recognize the specific case.
FIXED-IN:5.1.2

M  +7    -1    kmymoney/plugins/xml/kcm_xmlstorage.cpp

https://invent.kde.org/office/kmymoney/commit/b4d06aef8b54fad9e2704e3e28fd4b70734ee40e
Comment 6 Thomas Baumgart 2021-04-18 19:02:26 UTC
Git commit a0a20ba4d79c8dc61b5e4b27ea528486a4ecc368 by Thomas Baumgart.
Committed on 18/04/2021 at 18:54.
Pushed by tbaumgart into branch 'master'.

Show tooltip in xml storage settings dialog when GPG is not working

In case GPG is not installed or no GPG secret keys are available a
corresponding hint is displayed in the mentioned dialog so that the
user can recognize the specific case.

(cherry picked from commit b4d06aef8b54fad9e2704e3e28fd4b70734ee40e)

M  +7    -1    kmymoney/plugins/xml/kcm_xmlstorage.cpp

https://invent.kde.org/office/kmymoney/commit/a0a20ba4d79c8dc61b5e4b27ea528486a4ecc368
Comment 7 Nigel 2021-10-10 10:21:58 UTC
There's still a problem in the windows 5.1.2 version with it not detecting that gpg is installed. I've gone back to 4.8.4 which works.
(gpg also worked in 5.0.6 but online quotes did not work in that version.)

I'm using gpg4win 3.1.16.
Comment 8 Ralf Habacker 2021-10-13 09:45:41 UTC
(In reply to Nigel from comment #7)

> There's still a problem in the windows 5.1.2 version with it not detecting
> that gpg is installed.

To which build variant you are refering - to https://binary-factory.kde.org or kmymoney.org/snapshots.php.

The latter contains gpg (2.2) support and as long as gpg supports environment variables to select a different configuration directory and the current gpg4win version 3 is compatible to 2.2, an external installation of gpg should be usable with it.
Comment 9 Ralf Habacker 2021-10-13 09:57:49 UTC
(In reply to Ralf Habacker from comment #8)

> The latter contains gpg (2.2) support and as long as gpg supports
> environment variables to select a different configuration directory 

Just checked the gpg settings for gpg4win version 3.1.16

    $ /c/Program\ Files\ \(x86\)/Gnupg/bin/gpg --version
    gpg (GnuPG) 2.2.28

    $ /c/Program\ Files\ \(x86\)/Gnupg/bin/gpgconf --list-dirs
    sysconfdir:C%3a\ProgramData\GNU\etc\gnupg
    ...
    homedir:C%3a\Users\xxx\AppData\Roaming\gnupg


and for a recent kmymoney snapshot

    $ cd h/Downloads/kmymoney5-5.1+QT511+KF565+git.76b23fb89/bin
    $ ./gpg2 --version
    gpg (GnuPG) 2.2.27

    $ ./gpgconf --list-dirs
    sysconfdir:C%3a\ProgramData\GNU\etc\gnupg
    homedir:C%3a\Users\xxx/AppData\Roaming\gnupg

Both are using the same directories and gnupg version 2.2, so it should work out of the box with that kmymoney snapshot.
Comment 10 Nigel 2021-10-13 10:20:03 UTC
Hi Ralf,

Thanks for getting back so fast. The version I was tried was installed using "kmymoney-5.1-1143-windows-msvc2019_64-cl.exe" which is the latest stable release.

Should I be using a different version?

Best regards,

Nigel

-----Original Message-----
From: Ralf Habacker <bugzilla_noreply@kde.org> 
Sent: 13 October 2021 17:46
To: nhaines@yahoo.com
Subject: [kmymoney] [Bug 396016] KMYMoney GPG option is grayed out even though GPG installed

https://bugs.kde.org/show_bug.cgi?id=396016

--- Comment #8 from Ralf Habacker <ralf.habacker@freenet.de> --- (In reply to Nigel from comment #7)

> There's still a problem in the windows 5.1.2 version with it not 
> detecting that gpg is installed.

To which build variant you are refering - to https://binary-factory.kde.org or kmymoney.org/snapshots.php.

The latter contains gpg (2.2) support and as long as gpg supports environment variables to select a different configuration directory and the current gpg4win version 3 is compatible to 2.2, an external installation of gpg should be usable with it.

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 11 Ralf Habacker 2021-10-13 12:48:27 UTC
reply to Nigel from comment #10)
> Hi Ralf,
> 
> Thanks for getting back so fast. The version I was tried was installed using
> "kmymoney-5.1-1143-windows-msvc2019_64-cl.exe" which is the latest stable
> release.

That build does not have gpg support.
 
> Should I be using a different version?

The versions provided at https://kmymoney.org/snapshots.php does have gpg support.
Comment 12 Nigel 2021-10-13 18:14:24 UTC
Created attachment 142411 [details]
Screenshot 2021-10-14 020806.png

Hi Ralf,

I've installed version: mingw64-kmymoney5-setup-5.1+QT511+KF565+git.20211005T171409.bd835cb1c-lp152.97.2.noarch.rpm  

Encryption now works....but online quotes do not and I get the error attached. I've also attached the online quote settings for the online source. Are there any known issues with online quotes in this version?

If I cut and paste the line in a browser it returns information OK: http://query1.finance.yahoo.com/v7/finance/quote?fields=regularMarketPrice&symbols=VWRD.L

Best regards,

Nigel

-----Original Message-----
From: Ralf Habacker <bugzilla_noreply@kde.org> 
Sent: 13 October 2021 20:48
To: nhaines@yahoo.com
Subject: [kmymoney] [Bug 396016] KMYMoney GPG option is grayed out even though GPG installed

https://bugs.kde.org/show_bug.cgi?id=396016

--- Comment #11 from Ralf Habacker <ralf.habacker@freenet.de> --- reply to Nigel from comment #10)
> Hi Ralf,
> 
> Thanks for getting back so fast. The version I was tried was installed 
> using "kmymoney-5.1-1143-windows-msvc2019_64-cl.exe" which is the 
> latest stable release.

That build does not have gpg support.

> Should I be using a different version?

The versions provided at https://kmymoney.org/snapshots.php does have gpg support.

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 13 Nigel 2021-10-13 18:14:25 UTC
Created attachment 142412 [details]
Screenshot 2021-10-14 021136.png
Comment 14 Ralf Habacker 2021-10-14 06:53:05 UTC
Created attachment 142419 [details]
kmymoney test file

I tried to reproduce the mentioned issue with the appended test case, but was not able to see an issue.

What I did:
1. Opened the appended test file
2. Selected "Investments" in the left pane, right clicked at "VWRD.L" and choosed "update online price"

which worked as expected.
Comment 15 Ralf Habacker 2021-10-14 07:03:20 UTC
(In reply to Nigel from comment #12)

> I've installed version:
> mingw64-kmymoney5-setup-5.1+QT511+KF565+git.20211005T171409.bd835cb1c-lp152.
> 97.2.noarch.rpm  

I used the portable version 

> Encryption now works....but online quotes do not and I get the error
> attached.

which indicates a connection error. Are you using a proxy ? 

If the issue also happens with the portable version, please run kmymoney.exe from a command prompt to see more details what happens behind the scene.
Comment 16 Nigel 2021-10-14 08:55:28 UTC
Created attachment 142426 [details]
Screenshot 2021-10-14 164928.png

Hi Ralf,

I tried the portable version but get the same problem. I am not using a proxy that I'm aware of. (The same connection worked fine for online quotes with the earlier versions I was using that did not support gpg).

When I run kmymoney from the command prompt I get the two lines highlighted in yellow when I try to do an online price update - see attached.

Best regards,

Nigel

-----Original Message-----
From: Ralf Habacker <bugzilla_noreply@kde.org> 
Sent: 14 October 2021 15:03
To: nhaines@yahoo.com
Subject: [kmymoney] [Bug 396016] KMYMoney GPG option is grayed out even though GPG installed

https://bugs.kde.org/show_bug.cgi?id=396016

--- Comment #15 from Ralf Habacker <ralf.habacker@freenet.de> --- (In reply to Nigel from comment #12)

> I've installed version:
> mingw64-kmymoney5-setup-5.1+QT511+KF565+git.20211005T171409.bd835cb1c-lp152.
> 97.2.noarch.rpm

I used the portable version 

> Encryption now works....but online quotes do not and I get the error 
> attached.

which indicates a connection error. Are you using a proxy ? 

If the issue also happens with the portable version, please run kmymoney.exe from a command prompt to see more details what happens behind the scene.

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 17 Ralf Habacker 2021-10-15 06:51:53 UTC
(In reply to Nigel from comment #16)
> When I run kmymoney from the command prompt I get the two lines highlighted
> in yellow when I try to do an online price update - see attached.

With the test file append I get this: 

   created tmpfile
   Downloaded "C:/Users/xxx/AppData/Local/Temp/kmymoney.YqbXwW" from QUrl("https://query1.finance.yahoo.com/v7/finance/quote?fields=regularMarketPrice&symbols=VWRD.L")
   kmymoney_webpricequote: quotedata "{\"quoteResponse\":{\"result\":[{\"language\":\"en-US\",\"region\":\"US\",\"quoteType\":\"ETF\",\"quoteSourceName\":\"Delayed Quote\",\"triggerable\":false,\"exchange\":\"LSE\",\"exchangeTimezoneName\":\"Europe/London\",\"exchangeTimezoneShortName\":\"BST\",\"gmtOffSetMilliseconds\":3600000,\"market\":\"gb_market\",\"esgPopulated\":false,\"marketState\":\"PRE\",\"firstTradeDateMilliseconds\":1337670000000,\"priceHint\":2,\"regularMarketTime\":1634225714,\"regularMarketPrice\":119.36,\"fullExchangeName\":\"LSE\",\"sourceInterval\":15,\"exchangeDataDelayedBy\":20,\"tradeable\":false,\"symbol\":\"VWRD.L\"}],\"error\":null}}"
kmymoney_webpricequote: Price "119.36"
Comment 18 Nigel 2021-10-16 11:56:44 UTC
Created attachment 142499 [details]
2021_10_16 CMD trace
Comment 19 Nigel 2021-10-16 11:59:35 UTC
Hi Ralf,

Unfortunately I am still not getting online quotes. I'm using the test file you previously attached and have attached the full cmd trace file. Am I definately running the same version as you - mine is: kmymoney5-5.1+QT511+KF565+git.20211005T171409.bd835cb1c?

Best regards,

Nigel
Comment 20 Ralf Habacker 2021-10-22 20:34:43 UTC
(In reply to Nigel from comment #19)
> Unfortunately I am still not getting online quotes. I'm using the test file
> you previously attached and have attached the full cmd trace file. 

> Am I definately running the same version as you - mine is:
> kmymoney5-5.1+QT511+KF565+git.20211005T171409.bd835cb1c?
This is the 64 bit variant, which should also work 

Fetching that data is performed by a KF5 component named kio by using background processes named klauncher5.exe and kioslave5.exe. They open/uses a tcp connection for communication, which may be blocked by a firewall.
Comment 21 Nigel 2021-10-23 08:39:13 UTC
Hi Ralf,

I've gone back to this version kmymoney-mingw64-4.8.4-2.1-setup.exe and quotes work fine - same PC and firewall settings.

Best regards,

Nigel
Comment 22 Ralf Habacker 2021-10-25 22:12:45 UTC
(In reply to Nigel from comment #21)
> Hi Ralf,
> 
> I've gone back to this version kmymoney-mingw64-4.8.4-2.1-setup.exe and
> quotes work fine 

That version is KDE4 based and uses the alkimia library to fetch online quotes.

> same PC and firewall settings.

IF you reboot the computer and disable the firewall temporary before starting kmymoney/KF5 - are online quotes working ?
Comment 23 Nigel 2021-10-26 01:46:16 UTC
Hi Ralf,

Yes, I tried disabling the firewall and still did not work.

Best regards,

Nigel
Comment 24 Ralf Habacker 2021-10-27 11:57:37 UTC
Created attachment 142936 [details]
Screenshot showing KDE related processes

When you follow the the recipe mentioned at comment #14, do you see the processes mentioned in the screenshot ? If not which processes are missing ?
Comment 25 Nigel 2021-10-28 02:58:18 UTC
I see these processes:
Comment 26 Nigel 2021-10-28 03:00:46 UTC
Created attachment 142958 [details]
Screenshot of processes

I see these processes when I try to do an online update
Comment 27 Ralf Habacker 2021-10-28 10:07:17 UTC
(In reply to Nigel from comment #26)
> Created attachment 142958 [details]
> Screenshot of processes
> 
> I see these processes when I try to do an online update

Looks good.

Another workaround could be this recipe:

1. Start cmd.exe in the `bin` dir of the kmymoney installation 
2. enter 
     set KIO_FORK_SLAVES=1
     kmymoney
   and press return
4. try to update online quotes
Comment 28 Nigel 2021-10-29 00:09:04 UTC
Created attachment 142986 [details]
2021_10_29 CMD trace

Hi Ralf,

Still not working - see attached CMD trace.

Best regards,

Nigel
Comment 29 Nigel 2022-01-12 10:18:20 UTC
Hi Ralf, are there any new versions that might have addressed this issue please?
Comment 30 Ralf Habacker 2022-03-16 07:50:42 UTC
(In reply to Nigel from comment #29)
> Hi Ralf, are there any new versions that might have addressed this issue
> please?

Did you take a look at https://kmymoney.org/snapshots.php. There should be at least snapshots of the 5.1 branch for Windows including GPG and online banking.