Qalculate / libqalculate

Qalculate! library and CLI
https://qalculate.github.io/
GNU General Public License v2.0
1.88k stars 151 forks source link

Failed to download exchange rates from ECB #100

Closed Art-2 closed 6 years ago

Art-2 commented 6 years ago

$ qalc 1 USD to HNL It has been 97 day(s) since the exchange rates last were updated. Do you wish to update the exchange rates now? yes error: Failed to download exchange rates from ECB: . 1 * dollar = approx. HNL 23.568

hanna-kn commented 6 years ago

Which version of Qalculate! and operating system/distribution are you using? Does curl https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml work (does it return a list of exchange rates in xml format)? Is the directory ~/.local/share/qalculate present and writable?

Art-2 commented 6 years ago
  1. Qalculate 2.6.2 Xubuntu 18.04.1
  2. Yes, it works.
  3. Yes, I even manually download the eurofxref-daily.xml and placed it there but Qalculate! does not update it

imagen Maybe I did not compile the program well

hanna-kn commented 6 years ago

What character is it that the program fails to display correctly at the end of the error message?

Can you please try the following patch and post the error message you get when exchange rates are updated: 100_error.patch (apply with patch -p1 < 100_error.patch in the top directory in the libqalculate source)

Perhaps you could try the snap package and see if that works.

Art-2 commented 6 years ago

I do not know an appropriate way to share the character because it changes here in GitHub to this: 

Tell me if I did it right :~/libqalculate-master$ patch -p1 < 100_error.patch patching file libqalculate/Calculator.cc

then: qalc 1 USD It has been 98 day(s) since the exchange rates last were updated. Do you wish to update the exchange rates now? yes error: Failed to download exchange rates from ECB 2: Problem with the SSL CA cert (path? access rights?). 1 * dollar = approx. HNL 23.568

Using Qalculate-gtk 1 USD = 1 × dollar Failed to download exchange rates from ECB 1: . ≈ HNL 23.568

The problem is not present with the snap package but I do not want to have snap packages my system. :/

hanna-kn commented 6 years ago

The issue seems to be caused by a problem with libcurl and/or CA certificates on your system. I was able to reproduce the error by installing libcurl4-nss-dev instead of libcurl4-openssl-dev (changing libcurl packages requires recompilation of libqalculate).

The empty error message and the undisplayable character was caused by incomplete error handling (the curl error buffer is not always set when curl returns and error code and was not initialized).

Art-2 commented 6 years ago

Correct, I had the wrong package installed. I changed the libcurl package and everything is fine. Was my fault after all.

Thanks so much for the help.