[GNC] Problem getting Finance::Quote working
Tomas Volf
~ at wolfsden.cz
Wed Jan 1 19:07:49 EST 2025
Hello,
Today I installed gnucash and am trying to get fetch quotes from the
internet, and I am having troubles getting it to work. I am not
subscribed, so please CC.
When I try the `gnucash-cli --quotes info', it seems to work:
--8<---------------cut here---------------start------------->8---
$ /gnu/store/fq2bix6lr0rls6vld4xwb1dchkkdjnx1-gnucash-5.9/bin/gnucash-cli --quotes info
* 00:56:27 WARN <gnc.price-quotes> [GncFQQuoteSource::set_api_key()] No Alpha Vantage API key set, currency quotes and other AlphaVantage based quotes won't work.
Found Finance::Quote version 1.64.
Finance::Quote sources:
aex alphavantage amfiindia asegr asx
aufunds australia bamosz bats bet bloomberg
borsa_italiana bourso bse bseindia bvb
canada comdirect consorsbank cse deka dutch
dwsfunds europe fetch_live_currencies financeapi
finanzpartner fondsweb fool france ftfunds
goldmoney googleweb greece hu hufund hungary
hustock india indiamutual known_currencies marketwatch
morningstarau morningstarch morningstarjp
morningstaruk mstaruk nasdaq nseindia nyse
nzx onvista oslobors poland romania seb_funds
sinvestor six stockdata stooq tesouro_direto
tiaacref tmx tradegate tradeville treasurydirect
troweprice troweprice_direct tsp tsx twelvedata
ukfunds unionfunds usa xetra yahoo_json yahoojson
yahooweb za
--8<---------------cut here---------------end--------------->8---
However when I try to actually get some quotes, I get this "error":
--8<---------------cut here---------------start------------->8---
$ /gnu/store/fq2bix6lr0rls6vld4xwb1dchkkdjnx1-gnucash-5.9/bin/gnucash-cli --quotes dump australia CML
* 00:58:05 WARN <gnc.price-quotes> [GncFQQuoteSource::set_api_key()] No Alpha Vantage API key set, currency quotes and other AlphaVantage based quotes won't work.
CML Finance::Quote returned no data and set no error.
--8<---------------cut here---------------end--------------->8---
Which seems weird. The helper itself appears to work:
--8<---------------cut here---------------start------------->8---
$ echo '{"defaultcurrency": "USD","australia": {"CML": ""}}' | /gnu/store/fq2bix6lr0rls6vld4xwb1dchkkdjnx1-gnucash-5.9/bin/finance-quote-wrapper -f
{"australia":{"CML":{"name":"CONNECTED MINERALS LIMITED","success":1,"last":0.2,"method":"asx","price":0.2,"type":"","net":0,"errormsg":"","bid":0.18,"symbol":"CML","p_change":"0","volume":1019,"currency":"AUD","exchange":"Australian Securities Exchange","ask":0.2}}}
--8<---------------cut here---------------end--------------->8---
When I strace the `gnucash-cli' binary, it seems it does get the JSON
back:
--8<---------------cut here---------------start------------->8---
$ strace -v -s 8192 -- /gnu/store/fq2bix6lr0rls6vld4xwb1dchkkdjnx1-gnucash-5.9/bin/gnucash-cli --quotes dump australia CML
[..]
read(15, "{\"australia\":{\"CML\":{\"errormsg\":\"\",\"price\":0.2,\"net\":0,\"type\":\"\",\"bid\":0.18,\"success\":1,\"volume\":1019,\"name\":\"CONNECTED MINERALS LIMITED\",\"method\":\"asx\",\"p_change\":\"0\",\"currency\":\"AUD\",\"ask\":0.2,\"last\":0.2,\"symbol\":\"CML\"}}}\n", 512) = 224
[..]
write(1, "CML Finance::Quote returned no data and set no error.\n", 54CML Finance::Quote returned no data and set no error.
) = 54
[..]
--8<---------------cut here---------------end--------------->8---
I am on 5.9 version:
--8<---------------cut here---------------start------------->8---
$ /gnu/store/fq2bix6lr0rls6vld4xwb1dchkkdjnx1-gnucash-5.9/bin/gnucash-cli --version
GnuCash 5.9
Build ID: 5.9+(2024-09-28)
--8<---------------cut here---------------end--------------->8---
Would anyone have some suggestion what might be wrong and how I can fix
this?
Thank you and have a nice day,
Tomas Volf
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
More information about the gnucash-user
mailing list