Price Retrieval Failure, Part 2

John Ralls jralls at ceridwen.us
Thu Feb 8 11:33:33 EST 2018



> On Feb 8, 2018, at 6:52 AM, David T. via gnucash-user <gnucash-user at gnucash.org> wrote:
> 
> In thread https://lists.gnucash.org/pipermail/gnucash-user/2018-January/074224.html <https://lists.gnucash.org/pipermail/gnucash-user/2018-January/074224.html>, I noted that after upgrading my installation from 2.6.16 to 2.6.19 on my Mac (OS X 10.13.3), Price retrieval was failing with the generic error: "There was an unknown error while retrieving the price quotes.”
> 
> *** As I noted there: Finance::Quote works at the command line:
> 
> $ /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-check
> ("1.47" "adig" "aex" "aiahk" "alphavantage" "amfiindia" "asegr" "asia" "asx" "australia" "bamosz" "bet" "bmonesbittburns" "bourso" "brasil" "bse" "bsero" "canada" "canadamutual" "citywire" "cominvest" "cse" "deka" "dutch" "dwsfunds" "europe" "fetch_live_currencies" "fidelity" "fidelity_direct" "fidelityfixed" "financecanada" "finanzpartner" "finland" "fool" "france" "ftfunds" "ftportfolios" "ftportfolios_direct" "fundlibrary" "goldmoney" "greece" "hex" "hu" "hufund" "hungary" "hustock" "indiamutual" "known_currencies" "lerevenu" "maninv" "morningstar" "morningstarjp" "mstaruk" "nasdaq" "nyse" "nz" "nzx" "platinum" "romania" "seb_funds" "sixfunds" "sixshares" "stockhousecanada_fund" "tdefunds" "tdwaterhouse" "tiaacref" "tnetuk" "troweprice" "troweprice_direct" "trustnet" "tsp" "tsx" "uk_unit_trusts" "ukfunds" "unionfunds" "usa" "usfedbonds" "vanguard" "vwd" "yahoo" "yahoo_asia" "yahoo_australia" "yahoo_brasil" "yahoo_europe" "yahoo_json" "yahoo_nz" "yahoo_yql" "za" "za_unittrusts”)
> 
> $ /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-dump -v alphavantage AAPL
> Finance::Quote fields Gnucash uses:
>    symbol: AAPL                 <=== required
>      date: 02/08/2018           <=== recommended
>  currency: USD                  <=== required
>      last: 160.1350             <=\       
>       nav:                      <=== one of these
>     price:                      <=/        
>  timezone:                      <=== optional
> 
> *** As I noted earlier: I restored the following two lines to /Applications/Gnucash.app/Contents/Resources/etc/gnucash/environment:
> 
> # Set AlphaVantage API Key to allow Finance::Quote to work
> ALPHAVANTAGE_API_KEY=************8SET
> 
> It seems to me that somehow Gnucash.app is not reading or using the ALPHAVANTAGE_API_KEY that is stored in its environment file. Either that, or somehow my environment file is not properly configured. However, I do not see any way to test these hypotheses. 
> 
> Can anyone tell me how I might determine **FROM WITHIN GNUCASH.APP** whether the Alphavantage API key is being read, and what its value currently is? Is there any other way to troubleshoot this problem?

David,

There’s no UI for examining the environment. I can only say that it works for me on MacOS 10.13 and GnuCash 2.6.19.

If you’re willing to hack a bit you could add a snippet to GnuCash.app/Contents/Resources/bin/gnc-fq-helper to print out the value of the key:

  print (“Alphavantage Key: $ENV{‘ALPHAVANTAGE_API_KEY’}\n”}

Put it down at the bottom somewhere after the #Runtime comment. You’ll have to run GnuCash from the command line to see that output.

Geert pushed a commit last week that keeps the Alphavantage key in preferences instead of the environment file so that in 3.0 one won’t have to keep resetting the environment file.

Regards,
John Ralls


More information about the gnucash-user mailing list