On Tue, Mar 06, 2012 at 06:41:33PM +1100, Dmitry Smirnov wrote:
> While I agree that Gnucash perhaps should have a better error handling and
> show an error dialog on unsuccessful import,
> I'd like to point out that what you described is invalid XML.
Thanks for giving pointer to the source of the bug! Still, I think extra
effort to avoid silent data loss should be prudent thing to do, especially
in such package.
It is even bigger problem since the error might not be noted until after
quite some time (I've had thousands of transactions, and since there was no
warning and thousands of them seemed ok, it took me a while to note that
several hundreds were missing.)
> Would you be able to reproduce the issue with recent Gnucash version 2.4.10?
I've installed test instance of Debian Wheezy with gnucash version 1:2.4.10-1
For test datafile I've just attached to debian bug#658732, it refuses to
load the file *at all* with message:
"This file/URL appears to be from a newer version of GnuCash. You must
upgrade your version of GnuCash to work with this data."
However, even when the "&" character is removed from
silent_truncate_bug.gnucash, the 2.4.10 still refuses to open this file
with this error (note that corrected file loads normally in gnucash
2.4.4-1~bpo60+1 version with all 4 transactions)
So it seems 2.4.10 no longer wants to load XML files that previous versions
could :(
So, what I've done is create new example test file
"silent_truncate_bug_244_broken.gnucash" (attached).
I created it in following way:
1) made a copy from silent_truncate_bug.gnucash from my previous bug comment
2) replaced "&" with "and"
3) opened it in gnucash 2.4.4-1~bpo60+1, and saved it in 2.4.4 format.
4) opened it in editor, replaced "and" back to "&" and named it
silent_truncate_bug_244_broken.gnucash (and attached it in this mail)
when silent_truncate_bug_244_broken.gnucash is opened in 2.4.10-1, the bug
is still there (only 1 transaction out of 4 remains, the rest are silently
truncated).
Only difference is different ordering (as step 3 above in my example would
reorder the transactions in xml, so the first transaction [and only
survivor] will now be named "fourth one is also lost")
--
Opinions above are GNU-copylefted.
<?xml version="1.0" encoding="utf-8" ?>
<gnc-v2
xmlns:gnc="http://www.gnucash.org/XML/gnc"
xmlns:act="http://www.gnucash.org/XML/act"
xmlns:book="http://www.gnucash.org/XML/book"
xmlns:cd="http://www.gnucash.org/XML/cd"
xmlns:cmdty="http://www.gnucash.org/XML/cmdty"
xmlns:price="http://www.gnucash.org/XML/price"
xmlns:slot="http://www.gnucash.org/XML/slot"
xmlns:split="http://www.gnucash.org/XML/split"
xmlns:sx="http://www.gnucash.org/XML/sx"
xmlns:trn="http://www.gnucash.org/XML/trn"
xmlns:ts="http://www.gnucash.org/XML/ts"
xmlns:fs="http://www.gnucash.org/XML/fs"
xmlns:bgt="http://www.gnucash.org/XML/bgt"
xmlns:recurrence="http://www.gnucash.org/XML/recurrence"
xmlns:lot="http://www.gnucash.org/XML/lot"
xmlns:addr="http://www.gnucash.org/XML/addr"
xmlns:owner="http://www.gnucash.org/XML/owner"
xmlns:billterm="http://www.gnucash.org/XML/billterm"
xmlns:bt-days="http://www.gnucash.org/XML/bt-days"
xmlns:bt-prox="http://www.gnucash.org/XML/bt-prox"
xmlns:cust="http://www.gnucash.org/XML/cust"
xmlns:employee="http://www.gnucash.org/XML/employee"
xmlns:entry="http://www.gnucash.org/XML/entry"
xmlns:invoice="http://www.gnucash.org/XML/invoice"
xmlns:job="http://www.gnucash.org/XML/job"
xmlns:order="http://www.gnucash.org/XML/order"
xmlns:taxtable="http://www.gnucash.org/XML/taxtable"
xmlns:tte="http://www.gnucash.org/XML/tte"
xmlns:vendor="http://www.gnucash.org/XML/vendor">
<gnc:count-data cd:type="book">1</gnc:count-data>
<gnc:book version="2.0.0">
<book:id type="guid">73090cf77e8cb5d5e7e92e80371dc7e2</book:id>
<gnc:count-data cd:type="commodity">1</gnc:count-data>
<gnc:count-data cd:type="account">3</gnc:count-data>
<gnc:count-data cd:type="transaction">4</gnc:count-data>
<gnc:commodity version="2.0.0">
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
<cmdty:get_quotes/>
<cmdty:quote_source>currency</cmdty:quote_source>
<cmdty:quote_tz/>
</gnc:commodity>
<gnc:commodity version="2.0.0">
<cmdty:space>template</cmdty:space>
<cmdty:id>template</cmdty:id>
<cmdty:name>template</cmdty:name>
<cmdty:xcode>template</cmdty:xcode>
<cmdty:fraction>1</cmdty:fraction>
</gnc:commodity>
<gnc:account version="2.0.0">
<act:name>Root Account</act:name>
<act:id type="guid">78ed46fdf27695182bc5cd607231924a</act:id>
<act:type>ROOT</act:type>
</gnc:account>
<gnc:account version="2.0.0">
<act:name>drinks</act:name>
<act:id type="guid">00acc400000000000000000008622183</act:id>
<act:type>EXPENSE</act:type>
<act:commodity>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
</act:commodity>
<act:commodity-scu>100</act:commodity-scu>
<act:parent type="guid">78ed46fdf27695182bc5cd607231924a</act:parent>
</gnc:account>
<gnc:account version="2.0.0">
<act:name>wallet</act:name>
<act:id type="guid">00acc400000000000000000000720911</act:id>
<act:type>BANK</act:type>
<act:commodity>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
</act:commodity>
<act:commodity-scu>100</act:commodity-scu>
<act:parent type="guid">78ed46fdf27695182bc5cd607231924a</act:parent>
</gnc:account>
<gnc:transaction version="2.0.0">
<trn:id type="guid">00baca00000000000000000015905683</trn:id>
<trn:currency>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
</trn:currency>
<trn:date-posted>
<ts:date>2005-12-10 13:00:00 +0100</ts:date>
</trn:date-posted>
<trn:date-entered>
<ts:date>2005-12-10 13:00:00 +0100</ts:date>
</trn:date-entered>
<trn:description>fourth one is also lost</trn:description>
<trn:splits>
<trn:split>
<split:id type="guid">00beef00000000000000000010246148</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>6300/100</split:value>
<split:quantity>6300/100</split:quantity>
<split:account
type="guid">00acc400000000000000000008622183</split:account>
</trn:split>
<trn:split>
<split:id type="guid">00beef00000000000000000010246147</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>-6300/100</split:value>
<split:quantity>-6300/100</split:quantity>
<split:account
type="guid">00acc400000000000000000000720911</split:account>
</trn:split>
</trn:splits>
</gnc:transaction>
<gnc:transaction version="2.0.0">
<trn:id type="guid">00baca00000000000000000015905677</trn:id>
<trn:currency>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
</trn:currency>
<trn:date-posted>
<ts:date>2005-12-10 13:00:00 +0100</ts:date>
</trn:date-posted>
<trn:date-entered>
<ts:date>2005-12-10 13:00:00 +0100</ts:date>
</trn:date-entered>
<trn:description>marks & spencer</trn:description>
<trn:splits>
<trn:split>
<split:id type="guid">00beef00000000000000000010246136</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>22000/100</split:value>
<split:quantity>22000/100</split:quantity>
<split:account
type="guid">00acc400000000000000000008622183</split:account>
</trn:split>
<trn:split>
<split:id type="guid">00beef00000000000000000010246135</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>-22000/100</split:value>
<split:quantity>-22000/100</split:quantity>
<split:account
type="guid">00acc400000000000000000000720911</split:account>
</trn:split>
</trn:splits>
</gnc:transaction>
<gnc:transaction version="2.0.0">
<trn:id type="guid">00baca00000000000000000015905680</trn:id>
<trn:currency>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
</trn:currency>
<trn:date-posted>
<ts:date>2005-12-10 13:00:00 +0100</ts:date>
</trn:date-posted>
<trn:date-entered>
<ts:date>2005-12-10 13:00:00 +0100</ts:date>
</trn:date-entered>
<trn:description>third one is lost</trn:description>
<trn:splits>
<trn:split>
<split:id type="guid">00beef00000000000000000010246142</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>100000/100</split:value>
<split:quantity>100000/100</split:quantity>
<split:account
type="guid">00acc400000000000000000000720911</split:account>
</trn:split>
<trn:split>
<split:id type="guid">00beef00000000000000000010246141</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>-100000/100</split:value>
<split:quantity>-100000/100</split:quantity>
<split:account
type="guid">00acc400000000000000000008622183</split:account>
</trn:split>
</trn:splits>
</gnc:transaction>
<gnc:transaction version="2.0.0">
<trn:id type="guid">00baca00000000000000000000566786</trn:id>
<trn:currency>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>HRK</cmdty:id>
</trn:currency>
<trn:date-posted>
<ts:date>2007-02-23 13:00:00 +0100</ts:date>
</trn:date-posted>
<trn:date-entered>
<ts:date>2007-02-23 13:00:00 +0100</ts:date>
</trn:date-entered>
<trn:description>first one</trn:description>
<trn:splits>
<trn:split>
<split:id type="guid">00beef00000000000000000015003045</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>3800/100</split:value>
<split:quantity>3800/100</split:quantity>
<split:account
type="guid">00acc400000000000000000008622183</split:account>
</trn:split>
<trn:split>
<split:id type="guid">00beef00000000000000000015003044</split:id>
<split:reconciled-state>c</split:reconciled-state>
<split:value>-3800/100</split:value>
<split:quantity>-3800/100</split:quantity>
<split:account
type="guid">00acc400000000000000000000720911</split:account>
</trn:split>
</trn:splits>
</gnc:transaction>
</gnc:book>
</gnc-v2>
<!-- Local variables: -->
<!-- mode: xml -->
<!-- End: -->