After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 515502 - Replay of .log files causes wrong running sum in account
Replay of .log files causes wrong running sum in account
Status: RESOLVED DUPLICATE of bug 378638
Product: GnuCash
Classification: Other
Component: Import - Other
2.2.x
Other Linux
: Normal critical
: ---
Assigned To: Christian Stimming
Christian Stimming
Depends on:
Blocks:
 
 
Reported: 2008-02-10 00:02 UTC by Ben Bucksch
Modified: 2018-06-29 22:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot 1 (6.05 KB, image/png)
2008-02-10 00:04 UTC, Ben Bucksch
Details
Screenshot 2 (6.58 KB, image/png)
2008-02-10 00:05 UTC, Ben Bucksch
Details

Description Ben Bucksch 2008-02-10 00:02:47 UTC
See attached screenshots.

This is a bank account in GnuCash 2.2.0.

The problem seems to have introduced since I replayed the log files of another version of the file. Some time ago, I had saved the file under a different filename, to make a backup, and forgot to go back to main file, worked on the backup. Today, (instead of just copying the backup over the main file,) I replayed the .log files of the backup file on top of the main file. This must have caused this state here.

I still have the .log files, but they are privacy-sensitive of course, I won't send them around.
Comment 1 Ben Bucksch 2008-02-10 00:04:25 UTC
Created attachment 104805 [details]
Screenshot 1
Comment 2 Ben Bucksch 2008-02-10 00:05:00 UTC
Created attachment 104806 [details]
Screenshot 2
Comment 3 Phil Longstaff 2009-04-26 19:50:38 UTC
Not crash - major
Comment 4 Ben Bucksch 2009-04-26 20:51:08 UTC
Per http://bugzilla.gnome.org/page.cgi?id=bug-status.html#bug_severity ,
data loss is critical, and this is data loss - in fact, worse than data loss: silently *wrong* data.
Comment 5 Phil Longstaff 2009-04-26 21:21:33 UTC
Have you tried to save the file and reopen it to see if the values were corrected?  Those balance values are not permanent values but are recalculated.

Have you tried this again to see if it can be reproduced?
Comment 6 Ben Bucksch 2009-04-26 22:02:56 UTC
> Have you tried to save the file and reopen it to see if the values were
> corrected?

Yes. The problem was persistent. The only way I found to fix this was to go back to a much older file and manually redo everything I did since then.
Comment 7 Phil Longstaff 2009-04-26 22:27:06 UTC
I just tried the following:

1) Load file A
2) Save as file B (current file is now file B)
3) Add some transactions (to file B)
4) Save file B
5) Load file A
6) Replay file B's log

As far as I can tell, everything is OK.  I only added 2 transactions, one a deposit and one a withdrawal from a bank account.

Is there any other information you can provide?

I understand your privacy concern, but if I can't reproduce it, it makes it much harder to fix because I can't be sure I fixed your specific problem.  My understanding is that you have a data file (your "main file") and a log file (activity on your "backup file"), and that if you apply the log file to the data file, you get this corruption.  Can you send me those files?  Can you remove extra transactions from your data file and send me what's left?
Comment 8 Andreas Köhler 2010-02-03 00:17:42 UTC
Any update here?
Comment 9 Ben Bucksch 2010-02-03 09:42:28 UTC
I haven't been asked any concrete question.
For me, the problem is long solved for me by redoing everything (comment 6). I still have the fold, broken file and log files, though.
Comment 10 Geert Janssens 2010-03-14 19:47:42 UTC
I suspect this bug is a duplicate of bug 378638.

In the first example, the calculated balance is the result of adding 242 once and substracting 10744 three times:
18.105,11 + 242 - 10.744 - 10.744 - 10.744 = -13.884,89

In the second example, a similar calculation can be made:
7.358,28 - 6.647,92  - 6.647,92  = -5.936.56 (one transaction counted twice)
-5936.56 - 6.647,92  - 6.647,92 + 1.119,05 = -18.113,35 (same transaction counted twice more)
...

So it is very likely the log replay has recreated several transactions multiple times. According to bug 378638, this doesn't show because these transactions all have the same guid and hence are only displayed once in the register, but the balance calculation code does take all the transactions into account.

Ben, can you verify if the old, broken data file effectively has these transactions multiple times ?
Comment 11 Ben Bucksch 2010-03-14 23:27:18 UTC
Yes. I have 2 transactions, both with the same transaction IDs, split IDs and account IDs, with value 10.744.
I have 4 transactions (again with the same IDs everywhere) for 6.647,92.

It does sound like bug 378638.

Thanks a lot!

What's wondering me is why that was acknowledged by GnuCash developers, but, despite being an obvious and severe bug, not fixed. The bug costed me many hours, if not a day. Everybody who tries to replay any log file more than once (which is likely, given the many small log files written) would run into it, apparently.

*** This bug has been marked as a duplicate of bug 378638 ***
Comment 12 John Ralls 2018-06-29 22:01:03 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=515502. Please update any external references or bookmarks.