[GNC] GnuCash 5.5 (macOS) can't get quotes, because it doesn't see JSON::Parse

Jim DeLaHunt list+gnucash at jdlh.com
Sat Dec 23 15:29:15 EST 2023


Hi, folks:

I recently upgraded to GnuCash 5.5-1 on macOS, from 4.14 and a long 
succession of GnuCashes before that. I have been successfully retrieving 
quotes via AlphaVantage for a long time. With the upgrade to GnuCash 
5.5, that stopped working.

When I run the GnuCash 5.5 application, and open the Price Database 
window, the "Get Quotes" button is disabled.

When I ask gnucash-cli for quotes info, it says JSON::Parse is not 
installed:

% PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' 
/Applications/Gnucash.app/Contents/MacOS/gnucash-cli --quotes info
Application Path /Applications/Gnucash.app/Contents/MacOS/gnucash-cli
Failed to initialize Finance::Quote: missing_modules JSON::Parse

Similarly, when I run the GnuCash 5.5 application in --debug mode, and 
look at the log file, there is a message that JSON::Parse is missing:

/...[59 lines elided]...
/* 11:45:37  INFO <gnc.gui> [scm_run_gnucash] Attempt to load 
Finance::Quote returned this error message:
* 11:45:37  INFO <gnc.gui> [scm_run_gnucash] Failed to initialize 
Finance::Quote: missing_modules JSON::Parse
/...[134,149 lines elided]...
/

But the gnucash-fq-update utility thinks everything is fine:

% PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' sudo 
/Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-update
Password:

Starting with /...[elided].../ this dialog will disappear.
Reading '/Users/jdlh/.cpan/Metadata'
   Database was generated on Fri, 22 Dec 2023 23:54:07 GMT
Test2 is up to date (1.302198).
Finance::Quote is up to date (1.58).
JSON::Parse is up to date (0.62).

And CPAN seems to think that JSON::Parse is present:

% PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' sudo cpan
Password:
Loading internal logger. Log::Log4perl recommended for better logging

Starting with /...[elided].../ this dialog will disappear.
Terminal does not support /...[elided]...
/cpan shell -- CPAN exploration and modules installation (v2.36)
Enter 'h' for help.

cpan[1]> m JSON::Parse
Reading '/Users/jdlh/.cpan/Metadata'
   Database was generated on Fri, 22 Dec 2023 23:54:07 GMT
Module id = JSON::Parse
     CPAN_USERID  BKB (Ben Bullock <bkb at cpan.org>)
     CPAN_VERSION 0.62
     CPAN_FILE    B/BK/BKB/JSON-Parse-0.62.tar.gz
     UPLOAD_DATE  2022-07-15
     MANPAGE      JSON::Parse - Parse JSON
     INST_FILE /Library/Perl/5.30/darwin-thread-multi-2level/JSON/Parse.pm
     INST_VERSION 0.62


cpan[2]> install JSON::Parse
JSON::Parse is up to date (0.62).

Note that I am using MacPorts on this system. That sometimes leads to 
confusion, as described in 
<https://wiki.gnucash.org/wiki/Online_Quotes#Multiple_Perl_installations_on_macOS>. 
Thus I prefix commands with a PATH that excludes MacPorts, in the hopes 
that I will be checking only the system Perl locations which the GnuCash 
app consults.

For what it's worth, MacPorts has perl 5.34.3 installed, and the perl 
5.34 edition of JSON::Parse as well. The system has perl 5.30.3 
installed. I do not know if this difference is significant.

I have read through the wiki page Online Quotes. I think I have done 
what that page suggests. (Also, that page has now become a bit of a 
mess, because it mixes together instructions for several different 
online quotes tools from versions 5, 4, and pre-4 of GnuCash.)

Interestingly, when I run gnucash-cli from the GnuCash-provided 
application and a path that includes MacPorts, it seems happy with the 
Finance::Quote installation from MacPorts:

  % /Applications/Gnucash.app/Contents/MacOS/gnucash-cli --quotes info
Application Path /Applications/Gnucash.app/Contents/MacOS/gnucash-cli
Found Finance::Quote version 1.58.
Finance::Quote sources:
aex          alphavantage              amfiindia    asegr asx
/...[elided].../
xetra        yahoo_json   yahooweb     za

Thus I have a workaround: get quotes via gnucash-cli, which perhaps 
relies on the MacPorts installation of Finance::Quote rather than the 
built-in installation.

% /Applications/Gnucash.app/Contents/MacOS/gnucash-cli --quotes get 
/...[elided].../ledger.gnucash
Application Path /Applications/Gnucash.app/Contents/MacOS/gnucash-cli
Found Finance::Quote version 1.58.
%

Any suggestions for how to diagnose and fix the Get Quotes functionality 
within the GnuCash application?

Thank you in advance for your help. And many thanks to the GnuCash 
developers for all the improvements in the 5.x versions!
       —Jim DeLaHunt, Vancouver, Canada



More information about the gnucash-user mailing list