Knotty problem correcting errors reported by the consistency checker

I have been seeing consistency error reports for quite a long time. These all relate to accounts that are no longer active and have a zero final balance. The errors all appeared at exactly the same time - I believe it was several years ago when a new version of KMM improved account error checking.

Up to now, I have ignored these errors because they applied to inactive accounts and had no adverse effect on the rest of the system. However, I’m currently simplifying my finances and, as part of that exercise, would like to correct the errors so that the consistency checker runs clean.

The errors reported are all of the same type as these:-

  • The security ‘United Utilities’ has no price set for the opening date ‘2010-09-09’.
    Please enter a price for the security on or before the opening date.
    • The security ‘Royal Sun Alliance’ has no price set for the opening date ‘2010-09-09’.
      Please enter a price for the security on or before the opening date.
    • The security ‘Royal Dutch Shell’ has no price set for the opening date ‘2010-09-09’.
      Please enter a price for the security on or before the opening date.
    • The security ‘Premier Foods’ has no price set for the opening date ‘2010-09-09’.
      Please enter a price for the security on or before the opening date.
    • The security ‘Persimmon’ has no price set for the opening date ‘2010-09-09’.
      Please enter a price for the security on or before the opening date.
    • The security ‘Legal and General’ has no price set for the opening date ‘2010-09-09’.
      Please enter a price for the security on or before the opening date.
    • The security ‘Kingfisher plc’ has no price set for the opening date ‘2010-09-09’.

The errors all relate to equity accounts that were created on 2010-09-09. Prior to September 2010, I had investments that were spread across a number of investment brokers. In many cases the same equity was purchased from several different brokers. In September 2010, I consolidated these holdings by moving them between individual broker accounts.

I used the “Remove shares” and “Add shares” features to achieve this and, at the time, it all worked fine - no errors were reported and everything reconciled and balanced correctly.

Some time after this consolidation took place, KMM was updated and the consistency checker started to report the errors.

I’ve tried manually adding prices for 2010-09-09 for all the affected equities, but this has made no difference.

The prices are available, but it appears that KMM is unable to use them in these transactions.

Any suggestions as to how to fix this would be very welcome.

Linux Mint 21.2
KMyMoney 5.1.2

First, I’ll emphasize that those messages are warnings, not errors, and the only reason to eliminate them is for a cleaner looking (and less annoying) Consistency Check. You are also correct that they “suddenly” appeared after a program update, which added several additional checks to the Consistency Check. A future update will modify that warning to only appear if a price is not present on or before the first transaction referencing the security. However, in your case, it may not matter, because if the first transaction was an “add shares” that does not require adding a price for that date.

Now, you say you did add prices for the various mentioned securities on the opening date of those accounts. That really should have eliminated those warnings. However, note that the warning is issued for each security in each security account with a “missing” price. If you have owned the same security in different Investment accounts, it is possible that each one created a new security, instead of re-using the existing security. This is described at the bottom of Adding Investments to Your Account. I think the best way for you to tell is by looking at the Securities Tab of the Investments View and see if there are two entries for any of the securites receiving the warning. If that is the case, let us know, and we’ll figure out the best way to deal with it. Another way might be to look at the Price Editor (Tool/Prices… menu item) and see if any of the securities shows up twice. If so, enter that security or it’s trading symbol in the search box and click the “Show all stored prices” box. you will be able to see if there is an early enough price for both copies of the security, or just one.
Let us know what you find.

Thanks very much for your comprehensive reply to my post - it’s much appreciated.

Yes, I’ve lived with these warnings for a long time because they weren’t affecting my use of KMM, but I’ve got fed-up having to check that there are no new problems reported by the consistency checker each time I save the data. Having an account clean-up and a simplification of my finances was just an opportunity to get rid of them at last.

If I look at the Securities tab of the Investment View there are duplicate entries for all the security accounts that are giving me problems. In some cases there are three or four entries in total.

If I look at the Price Editor and, for example, select Royal Sun Alliance, I see the numerous price entries that resulted from me downloading pricing information for all my investments on a regular basis. All the entries for Royal Sun Alliance have exactly the same name and the same RSA.L ticker. There is no indication of any duplicates - each date has a single price entry. The earliest price entry for RSA is on 21-02-2005 (this one is a user input), and the final entry is for 23-05-2014. The sources for the intervening prices are a mixture of QIF Imports and Yahoo downloads.

I’ve also had a look around the XML datafile to see if I could learn anything more.

If I search the file for Royal Sun Alliance, there are four entries:-

  <ACCOUNT parentaccount="A000282" id="A000424" institution="" name="Royal Sun Alliance" number="" lastmodified="2011-02-10" opened="2005-02-21" type="15" description="" currency="E000028" lastreconciled="">
    <PAIR key="mm-closed" value="yes"/>

<ACCOUNT parentaccount="A000283" id="A000518" institution="" name="Royal Sun Alliance" number="" lastmodified="2014-05-27" opened="2010-09-09" type="15" description="" currency="E000073" lastreconciled="">
    <PAIR key="mm-closed" value="yes"/>

<SECURITY trading-market="" id="E000028" name="Royal Sun Alliance" trading-currency="GBP" rounding-method="0" type="0" saf="1" pp="4" symbol="RSA.L">
    <PAIR key="kmm-online-factor" value="100/10000"/>
    <PAIR key="kmm-online-source" value="Yahoo UK"/>

<SECURITY trading-market="" id="E000073" name="Royal Sun Alliance" trading-currency="GBP" rounding-method="0" type="0" saf="1" pp="4" symbol="RSA.L">
    <PAIR key="kmm-online-factor" value="100/10000"/>
    <PAIR key="kmm-online-source" value="Yahoo UK"/>

From this, it appears that RSA crops up in accounts A000282 and A000283

<ACCOUNT parentaccount="A000094" id="A000282" institution="" name="Selftrade Stocks  (D)" number="" lastmodified="" opened="2003-01-01" type="7" description="" currency="GBP" lastreconciled="">
    <SUBACCOUNT id="A000410"/>
    <SUBACCOUNT id="A000411"/>
    <SUBACCOUNT id="A000412"/>
    <SUBACCOUNT id="A000413"/>
    <SUBACCOUNT id="A000414"/>
    <SUBACCOUNT id="A000415"/>
    <SUBACCOUNT id="A000416"/>
    <SUBACCOUNT id="A000417"/>
    <SUBACCOUNT id="A000418"/>
    <SUBACCOUNT id="A000419"/>
    <SUBACCOUNT id="A000420"/>
    <SUBACCOUNT id="A000421"/>
    <SUBACCOUNT id="A000422"/>
    <SUBACCOUNT id="A000423"/>
    <SUBACCOUNT id="A000424"/>
    <SUBACCOUNT id="A000425"/>
    <SUBACCOUNT id="A000426"/>
    <SUBACCOUNT id="A000473"/>
    <SUBACCOUNT id="A000478"/>
    <SUBACCOUNT id="A000480"/>
    <SUBACCOUNT id="A000482"/>
    <SUBACCOUNT id="A000496"/>
    <PAIR key="IBAN" value=""/>
    <PAIR key="kmm-iconpos" value="110;227"/>
    <PAIR key="mm-closed" value="yes"/>

<ACCOUNT parentaccount="A000094" id="A000283" institution="" name="Hargreaves Lansdown Trading" number="" lastmodified="" opened="2007-01-01" type="7" description="" currency="GBP" lastreconciled="">
    <SUBACCOUNT id="A000427"/>
    <SUBACCOUNT id="A000517"/>
    <SUBACCOUNT id="A000518"/>
    <SUBACCOUNT id="A000519"/>
    <SUBACCOUNT id="A000520"/>
    <SUBACCOUNT id="A000521"/>
    <SUBACCOUNT id="A000522"/>
    <SUBACCOUNT id="A000523"/>
    <SUBACCOUNT id="A000524"/>
    <SUBACCOUNT id="A000525"/>
    <SUBACCOUNT id="A000526"/>
    <SUBACCOUNT id="A000527"/>
    <SUBACCOUNT id="A000528"/>
    <SUBACCOUNT id="A000529"/>
    <SUBACCOUNT id="A000530"/>
    <SUBACCOUNT id="A000531"/>
    <SUBACCOUNT id="A000532"/>
    <SUBACCOUNT id="A000533"/>
    <SUBACCOUNT id="A000534"/>
    <SUBACCOUNT id="A000535"/>
    <SUBACCOUNT id="A000536"/>
    <PAIR key="IBAN" value=""/>
    <PAIR key="kmm-iconpos" value="110;62"/>
    <PAIR key="mm-closed" value="yes"/>

I then looked at the ledger for each of those accounts.

Royal Sun Alliance was purchased in account Selftrade Stocks (D) on 21-02-2005 and the shares were removed using Remove Shares on 09-09-2010

Royal Sun Alliance was added to Hargreaves Lansdown Trading using Add Shares on 09-09-2010 and were later sold on 23-05-14.

Thanks for your help. Please let me know if you need any more information or would like me to try anything.

The fact that you have two <SECURITY… entries for the same stock name and symbol is the root of the problem. (It’s likely to have a parallel situation for the other problem securities.)
E000028 is held in the security account A000424 which is held in the investment account A000282 (Selftrade Stocks (D).
E000073 is held in the security account A000518 which is held in the investment account A000283 (Hargreaves Lansdown Trading)

If you look in your file for a section starting with then find the sections for <PRICEPAIR… for both E000028 and E000073, I suspect one of them will have far fewer entries than the other. In the Price Editor, if you can find the entry for that one (difficult, since the name and symbol are the same - that’s why to filter on the name and tick all entreis) you can enter a price for the opening date. You could also create it right in the XML file, but be sure to have sufficient backups just in case.

In the past, I have managed to actually eliminate one of the underlying securites by converting all transactions for it to the other security, but that still makes my eyes cross thinking about the contortions it required.

Hopefully this will at least let you see exactly where the problem is. We can have further discussions about options on fixing it.

Thanks again for all your help. I’ve managed to get rid of all the warnings reported by the consistency checker :+1:

You were absolutely right about the duplicates. Checking the <PRICEPAIR… sections for E000028 and E000073 confirmed that there were far more entries in one than the other. My apologies - I misled you over the issue of duplicates shown in the pricing tool. They were there - I just hadn’t been thorough enough when checking for them.

With a bit of digging in the XML file, I was able to list the investment accounts in which the securities with a consistency error check were held. Having done that, I found that almost all of the warnings occurred where the security account was opened with an “Add shares” transaction.

The consistency checker warnings associated with these “Add shares” transactions were resolved by applying a “Buy” transaction (for a single share for the date on which the “Add shares” occurred) for the correct daily price. No interest, fees, etc, values were entered. Having stored that transaction the warning for that security disappeared from the consistency check. I also found that I could then delete the “Buy” transaction without the error coming back. So the ledger looks exactly as it did before I started this exercise and the errors are solved.

There were a couple of errors that didn’t exactly fall into this category. In a handful of cases the security account was opened with a normal “Buy” transaction which, at least in the ledger, showed that it had an associated price - but for some reason the consistency checker wasn’t seeing it. I fixed these using the “buy one share and then delete the buy transaction” process that I’d used to fix the other warnings. Maybe there was some sort of corruption in the original transaction, or in the data file which meant that the price that appeared in the ledger wasn’t seen by the consistency checker…?

If I’ve missed a trick and have possibly screwed-up my data, please let me know! As I said at the outset, my objective was to cure the problems that were upsetting the consistency checker. All these investment accounts are being closed and are only going to be used for the occasional historic report.

Thanks again for all you help.

I have a similar problem as described above and I’m wondering should I extend this thread with my situation or should I create a new topic?
Just asking before I’m high-jacking this thread. :slight_smile:

Unless you have an easier solution to the same problem, I would start a new thread.