Bug 401137 - Failed to retrieve an exchange rate - Update Stock & Currency Prices
Summary: Failed to retrieve an exchange rate - Update Stock & Currency Prices
Status: RESOLVED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: bugtracker (show other bugs)
Version: git (master)
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-17 12:38 UTC by Michael Carpino
Modified: 2018-12-03 08:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot 1 (124.22 KB, image/png)
2018-11-18 14:52 UTC, Michael Carpino
Details
Screenshot 2 (92.26 KB, image/png)
2018-11-18 14:52 UTC, Michael Carpino
Details
Screenshot 3 (102.36 KB, image/png)
2018-11-18 14:53 UTC, Michael Carpino
Details
Screenshot 4 (164.27 KB, image/png)
2018-11-18 14:57 UTC, Michael Carpino
Details
Script to remove invalid price pairs confusing the application (1.17 KB, application/x-perl)
2018-12-03 08:03 UTC, Thomas Baumgart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Carpino 2018-11-17 12:38:10 UTC
SUMMARY

When I update my Stock prices within KMM I receive a Price Update Failed message.  The message I receive is "Failed to retrieve an exchange rate for USD > E000015 from KMyMoney Currency. It will be skipped this time."  This occurs 6 different times with my pricing updates.  Within the status box this message appears, 
"Fetching URL https://fx-rate.net/USD/E000003...
Identifier found: 'USD/"'
Date found: 'Sat Nov 17 2018'
Unable to update price for USD > E000003 (no price or no date)"

The difference for each error is the "E0000..".  I would like to stop receiving these error messages but can't figure out a way to eliminate them.

STEPS TO REPRODUCE
1. Update stock prices
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT

No error message as I have a valid stock price already updating.


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 4.19.1-1-MANJARO
(available in About System)
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Comment 1 Thomas Baumgart 2018-11-18 10:26:31 UTC
It looks like your data file has been corrupted for some reason which is causing this. Here's howto check:

1. Open the investment view and select the securities tab
2. Check for any E###### in the symbol column
3. For those that contain such a value, you need to change the symbol

Here's how to do that:

1. Switch to the Equities tab in the investment view

Repeat the following steps for each one of the items in the above list

2. Select the relevant investment account (once for each account)
3. For each equity listed with a symbol of said format, right click on it and select 'Edit investment...'.
4. Click 'Next'
5. Change the value of the trading symbol field to the needed symbol for price update
6. Click 'Next', click 'Finish'

Depending on the version you use, you might not be able to do all this (a recent git master or 5.0.2 is not affected). Please report back if you have problems or the problem persists, the instructions are unclear or whatever. Please close the bug as 'FIXED' 'WORKSFORME' in case you resolve the problem.
Comment 2 Michael Carpino 2018-11-18 14:50:33 UTC
I tried your recommendation, however, I can't edit the securities based on your solution.  The corruption is related to somehow the securities have been labeled as a currency that don't exist.  

I have attached 3 screenshots to help with possibly identifying the problem. Screenshot 1 shows some of my securities.  Please note Berkshire.  Now go to screenshot 2, Update Stock and Currency Prices, Berkshire's internal ID is E000003.  Screenshot 3, Update Stock and Currency prices, there is an ID Label of USD > E000003 source KMyMoney Currency.  I don't have a security nor a currency labeled this in my database.  The problem here is when I update prices it keeps trying to update the 6 currencies in screen 3 labeled "USD > ....".
Comment 3 Michael Carpino 2018-11-18 14:52:20 UTC
Created attachment 116382 [details]
Screenshot 1
Comment 4 Michael Carpino 2018-11-18 14:52:44 UTC
Created attachment 116383 [details]
Screenshot 2
Comment 5 Michael Carpino 2018-11-18 14:53:03 UTC
Created attachment 116384 [details]
Screenshot 3
Comment 6 Michael Carpino 2018-11-18 14:57:05 UTC
Created attachment 116385 [details]
Screenshot 4

This screenshot shows the errors of the update
Comment 7 Thomas Baumgart 2018-11-20 19:42:57 UTC
Thank you for the detailed screenshots. They explain a lot. Nevertheless, this looks a bit strange.

Can you follow directions on https://docs.kde.org/stable4/en/extragear-office/kmymoney/details.formats.anonymous.html and send the anonymized file to my private mail address. Depending on the version of KMyMoney you have, it could be, that you cannot create the anonymized file (this used to be a bug fixed in 5.0.3). Consider using the AppImage version to create it (https://binary-factory.kde.org/job/KMyMoney_Nightly_Appimage_Build/)
Comment 8 Thomas Baumgart 2018-12-03 08:03:15 UTC
Created attachment 116642 [details]
Script to remove invalid price pairs confusing the application

The problem was some corrupted data contained in the users file. The anonymous file he provided helped a lot to analyze the problem and solve it (removing the invalid data). I sent him the attached perl script wich took care of it.