error parsing

Vaughn Family Farm, Bryant bcvaughn at windstream.net
Sun Mar 4 14:38:13 EST 2012


As I have now tried to manually edit the many, many, many transactions, with
the same error parsing error.  Here are the instructions I am following:

Q: When I try to open my datafile on Windows, I get "Parse error". What
happened ?
A: There is a peculiarity in GnuCash on Windows when you use the Opening
balance tab of the account dialog. If you enter a two-digit year in that
tab, the date is not saved properly. Subsequently, when you reopen your
datafile afterwards, GnuCash thinks it's invalid. If you encounter such a
situation, you can attempt to fix your data file manually. 
Make a copy of your data file and uncompress it (with a tool like 7Zip). 
Open the uncompressed file with a text editor such as Wordpad or Notepad++.
This is an xml file. xml looks a bit like html, but uses different tag
names. 
Look for transaction sections that are missing a <trn:date-posted section>.
If you find such transactions, add the <trn:date-posted> section below the
<trn:currency> section, like so: 
 <trn:currency>
 ...
 </trn:currency>
 <trn:date-posted>
 <ts:date>2011-07-06 00:00:00 -0400</ts:date>
 </trn:date-posted>
Obviously, you can enter the date that suits you, but keep the format as
shown. 
When all transactions have a <trn.date-posted> section, save your file. 
It should now open with GnuCash again 
You could run into the same problem when you enter opening balances via the
New Account Hierarchy Assistant. The solution is the same: you will have to
add the missing <trn:date-posted> sections. 
Note: This problem occurs in all versions of GnuCash 2.4.x and older. It
will be fixed in version 2.6.x when it is released.

_____

Should I be searching for every occurrence of <trn:currency> (without the
slash mark between the "<" symbol and the "t") - these seem to be the ones
which are not followed by a <trn:date-posted>... ?  and then replace it or
add after it?  In other words do I leave the "<trn:currency> or replace it
with </trn:currency> as it seems to say above.  I have already tried to
replacing it but I get the same parsing error after I try to open the file,
with all of the accounts given a zero balance.

Thanks,
Bryant


-----Original Message-----
From: Geert Janssens [mailto:janssens-geert at telenet.be] 
Sent: Friday, March 02, 2012 11:51 AM
To: Derek Atkins
Cc: Vaughn Family Farm, Bryant; gnucash-user at gnucash.org
Subject: Re: error parsing

Op vrijdag 2 maart 2012 11:37:05 schreef Derek Atkins:
> Hi,
> 
> "Vaughn Family Farm, Bryant" <bcvaughn at windstream.net> writes:
> > Contents of the trace file, after the parsing error.  Thanks, Bryant
> > 
> > * 06:17:03  WARN <qof.engine> [guid_init()] only got 1320 bytes.
> > The identifiers might not be very random.
> > * 06:17:15  WARN <gnc.app-utils> Could not spawn perl: Failed to 
> > execute child process (No such file or directory)
> > * 06:17:15  CRIT <gnc.io> [dom_tree_handlers_all_gotten_p()] Not 
> > defined and it should be: trn:date-posted
> > * 06:17:15  CRIT <gnc.io> [dom_tree_generic_parse()] didn't find all 
> > of the expected tags in the input
> > * 06:17:15  WARN <gnc.backend> [gnc_xml_be_load_from_file()] Syntax 
> > error in Xml File C:\Documents and Settings\Owner\My 
> > Documents\Bryant's Documents\gnubackup.gnucash
> 
> [ snip]
> 
> >> There are a few corner cases that can lead to a parse error on 
> >> Windows.
> >> 
> >> To get a better idea of what is going on, can you post the contents 
> >> of the gnucash trace file that is generated right after the parse 
> >> error ? Follow the instructions in this link to find the trace file:
> >> http://wiki.gnucash.org/wiki/Windows#Error_messages.2C_Trace_file
> >> 
> >> Geert
> 
> I believe this is one of the corner cases, due to a bug when you 
> assign an opening balance on Windows.  The bug has been fixed in trunk 
> but was never back-ported to 2.4.  Alas, the only way to fix this is 
> to either hand-edit your data file to fix the problem or to revert to 
> a backup and re-enter the data but *not* assign an opening balance 
> when you create the accounts, but rather create the opening balance by
hand afterwards.
> 
> I'm sure Geert will respond with the BugID for more info.
> 
I don't know the bug id without looking it up, but I wrote a faq entry for
this error some time ago:
http://wiki.gnucash.org/wiki/FAQ#Q:_When_I_try_to_open_my_datafile_on_Window
s.2C_I_get_.22Parse_error.22._What_happened_.3F

It briefly explains what went wrong and how to fix it. As Derek mentions it
will require manual editing of the data file.

Geert



More information about the gnucash-user mailing list