Bug 431482 - 1 Online Quotes does not work and can not be corrected
Summary: 1 Online Quotes does not work and can not be corrected
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.1
Platform: Archlinux Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-12 10:09 UTC by jen83
Modified: 2021-01-18 19:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.2


Attachments
Error Message from online quoting (50.26 KB, image/png)
2021-01-12 10:09 UTC, jen83
Details
Anonymous file with the reproductible error (789.52 KB, application/xml)
2021-01-12 21:04 UTC, jen83
Details
how to fix (2.40 MB, image/gif)
2021-01-13 12:27 UTC, antoine
Details
quotes to delete (79.90 KB, image/png)
2021-01-13 19:33 UTC, antoine
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jen83 2021-01-12 10:09:54 UTC
Created attachment 134765 [details]
Error Message from online quoting

SUMMARY
See picture attached. As I start the online quotes, everything works fine but for an internal reference called EUR E000021. I searched for hours trying to find the source of the problem so that I could get rid of this one which I do not need (I suppose). But I can't find the related objects and as I cleaned all investment I now suppose there is a glitch in the database ...

The glitch appears some time ago, after a version change and after I closed a lot of accounts / investments.

STEPS TO REPRODUCE
1. Start Kmymoney
2. Start online quotes
3. Start all or select this reference
4. Quote fails.
5. Quote can not be deleted / modified or influenced (or I miss something ?)


OBSERVED RESULT
Quote fails. No Relation with an active / opened investment whatsoever or any currencies active in my system. Database corruption suspected.

EXPECTED RESULT
I expect to be able to correct / suppress this quote request. But I can not find any related object or any way to do it.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Kernel Version: 5.9.14-arch1-1
OS Type: 64-bit
Processors: 4 × AMD Athlon(tm) X4 860K Quad Core Processor
Memory: 15.6 Gio of RAM
Graphics Processor: AMD Radeon ™ RX 480 Graphics

ADDITIONAL INFORMATION
I used French as PC language.
Comment 1 antoine 2021-01-12 11:38:32 UTC
> See picture attached. As I start the online quotes, everything works
> fine but
> for an internal reference called EUR E000021. I searched for hours
> trying to
> find the source of the problem so that I could get rid of this one
> which I do
> not need (I suppose). But I can't find the related objects and as I
> cleaned all
> investment I now suppose there is a glitch in the database ...
> 

From your picture, I think that E000021 is related to AXA stock. 
I think you should edit this stock to stop (or correct) the online
update.

> The glitch appears some time ago, after a version change and after I
> closed a
> lot of accounts / investments.
> 
> OBSERVED RESULT
> Quote fails. No Relation with an active / opened investment
> whatsoever or any
> currencies active in my system. Database corruption suspected.
> 
You can check your database (tools > check integrity) but I do not
think this is the case.
Comment 2 jen83 2021-01-12 13:29:28 UTC
Hi Antoine, thanks for the quick reply.
That's why I opened a bug report and not a post on a forum because I am 100% sure I have no longer any AXA Stock where the online quotes is enable. I spend some hours to verify all my investment items ... None of them has a similar intenal ID or similar Data.

And as you can see from the picture, the format is also weird with numbers and AXA in the same column. This shouldn't be the case.
I am wondering what for an object it is / it comes from.

Maybe I forgot to mention, that this quote appeared "from itself". as I said, I migrated to a newer version of Kmymoney and after some corrections, I notice this in the online quote but it seems not to be linked to something I really created.

Any other Idea ?
Comment 3 jen83 2021-01-12 13:33:40 UTC
maybe to precise my thought : it seems to be a mix between a currency quote and a stock quote and I wonder how this is possible ...

That's why I said, it might be a glitch.

BTW Consitency check says "everything ok"
Comment 4 antoine 2021-01-12 16:05:49 UTC
Could you provide a anonymized file that duplicate the issue ?
Comment 5 antoine 2021-01-12 16:06:20 UTC
Could you provide a anonymized file that duplicate the issue ?
Comment 6 jen83 2021-01-12 18:14:56 UTC
Yes I have a anonymous file and I think I can find the false/wrong information at the very end of the 10 MB file ... (so I can't send it to you here ...)

 <SECURITY rounding-method="7" type="0" trading-market="EUREX" pp="4" name="E000021" trading-currency="EUR" id="E000021" symbol="AXA.F" saf="1">
   <KEYVALUEPAIRS>
    <PAIR value="xxxxxxxxxxxx" key="kmm-security-id"/>
   </KEYVALUEPAIRS>
  </SECURITY>

And later

  </PRICEPAIR>
  <PRICEPAIR from="EUR" to="E000021">
   <PRICE price="2075/44212" date="2019-09-26" source="Utilisateur"/>
   <PRICE price="49/1000" date="2021-01-10" source="KMyMoney Currency"/>
  </PRICEPAIR>



How should I send it to you ?
Comment 7 Thomas Baumgart 2021-01-12 20:22:19 UTC
gzip the file and attach it to this bug entry (via the web interface)
Comment 8 jen83 2021-01-12 21:04:28 UTC
Created attachment 134794 [details]
Anonymous file with the reproductible error

sometimes I feel stupid ... file attached and zipped ;-)
Comment 9 antoine 2021-01-13 12:27:45 UTC
Created attachment 134802 [details]
how to fix

Hi,
I think I found how to fix your issue.
I closed the AXA stock and I think it is working now.
Look at the video
Comment 10 jen83 2021-01-13 18:25:28 UTC
Well, you didn't fix the error, you just make it disappear under the carpet ;-) ... but if I need to reopen it, or If I rebuy this stock, I will get the same issue. (I tried this before).

However what I did notice this time  thanks to your video : this stock does create 2 quotes requirements : first 1 is working properly while the other is messed up.

And I want to correct this glitch. So maybe you understand better my issue ? why do I get 2 quotes ? how can I correct this ?
Comment 11 antoine 2021-01-13 19:33:44 UTC
Created attachment 134817 [details]
quotes to delete

(In reply to jen83 from comment #10)
> Well, you didn't fix the error, you just make it disappear under the carpet
> ;-) 

^^ you are right
I have been looking at your file and I think I found a way to fix this issue, I notice that this stock (AXA) has multiple quotes on the same day, this is maybe why you have problem

delete these 2 quotes (Utilisateur/Kmymoney currency) as shown on the picture (do not forget to do a backup before that)
Comment 12 jen83 2021-01-13 19:46:34 UTC
And yessss ! it did work. That was it, this double entry ... dunno how it happens but I deleted all the entries here and now it does not happen anymore and Kmymoney is also not complaining anymore. I launched the online quote for the AXA Stock and it worked correctly too.

So I don't know why and how it was created in the first place, but you manage to solve the issue. Thanks a lot for your time and your effort !
Comment 13 antoine 2021-01-13 19:51:55 UTC
you erase only these 2 quotes, right ?
you may be in trouble if you erase more than these 2 quotes

you can perform a consistency check to check that everything is ok
Comment 14 antoine 2021-01-13 19:54:14 UTC
not sure if we can consider this issue as FIXED
there is maybe something to do in kmymoney to make sure that this kind of situation never happen
Comment 15 jen83 2021-01-13 20:29:24 UTC
Good question ... no I had to delete more than 2. I actually had to delete twice the 3 of the AXA quotes I had and that were related. Tried it separately but it wasnt working.

I checked the integrity and the software says fine ... I also do not know why you think it could be a problem. A quote is just a value in time. It does not impact the books right ?

Honestly I do not know if you need to take action. It is certainly weird and not wanted ... I assume I know quite well what I do and I certainly did not do that on purpose. I am also quite curious to know how it could happened in the first place.

But I also suppose it was due to a very rare / uncommon situation : system / version upgrade and creation of different stocks with the same name in different account AND trying to update everything several time ... In the last 14 years I have been using the software, it is the only error of his kind I saw. and I still do not know how to reproduce it.

There are some more errors with investments though that are, on the contrary on this one, reproducible... but it doesn't bothered me much so I didn't report them. Should I ?

Same with loans ;-) Especially over such a long time and with newer version ... old items tends to lack consistency. Especially when loans are not so common, it does not work well (in fine loan for instance or combined loans). But it is another topic.
Comment 16 antoine 2021-01-14 12:04:23 UTC
> I checked the integrity and the software says fine ... I also do not
> know why
> you think it could be a problem. A quote is just a value in time. It
> does not
> impact the books right ?

in my opinion, it could impact the books if you delete a "transaction"
quotes

if the integrity check is ok, then it should be ok


> There are some more errors with investments though that are, on the
> contrary on
> this one, reproducible... but it doesn't bothered me much so I didn't
> report
> them. Should I ?

depending on your issue, you should report on the forum or create a bug
report, it could help to improve this software

> Same with loans ;-) Especially over such a long time and with newer
> version ...
> old items tends to lack consistency. Especially when loans are not so
> common,
> it does not work well (in fine loan for instance or combined loans).
> But it is
> another topic.

you can also create a bug report if you have issues with loans, please
check that your issue has not already been reported before creating a
bug report
Comment 17 Thomas Baumgart 2021-01-18 19:43:27 UTC
Git commit 06f4ac681a6d0ad3aaf5a184a6add2b86dc9157d by Thomas Baumgart.
Committed on 18/01/2021 at 19:43.
Pushed by tbaumgart into branch '5.1'.

Fix generation of price entries for securities

In certain circumstances, price entries were generated with the
conversion from currency to security. This caused the automatic price
update to fail.

This change prevents those entries in that it corrects the order and
uses the reciprocal price.

Already existing entries causing the problem are not corrected by this
fix.

See also https://forum.kde.org/viewtopic.php?f=69&t=169077
FIXED-IN: 5.1.2

M  +15   -2    kmymoney/mymoney/mymoneyfile.cpp

https://invent.kde.org/office/kmymoney/commit/06f4ac681a6d0ad3aaf5a184a6add2b86dc9157d