"There was an error parsing the file..." (invoice:owner missing)

Derek Atkins derek at ihtfp.com
Fri Jun 1 11:39:38 EDT 2012


Hi,

On Fri, June 1, 2012 11:24 am, Mike C. Fletcher wrote:
> I've now started running into this failure quite consistently, it
> re-corrupts my file each time I save it, so it seems I need to ask how
> to go about fixing it (since it's now blocking me from invoicing people).
>
> * 11:00:13  CRIT <gnc.io> [dom_tree_handlers_all_gotten_p()] Not defined
> and it should be: invoice:owner
> * 11:00:13  CRIT <gnc.io> [dom_tree_generic_parse()] didn't find all of
> the expected tags in the input
> * 11:00:13  CRIT <gnc.io> [dom_tree_to_invoice()] failed to parse
> invoice tree
> * 11:00:13  WARN <gnc.backend> [gnc_xml_be_load_from_file()] Syntax
> error in Xml File
> /mnt/homevar/home/mcfletch/business/accounting/vrplumber-con
> sulting-recovery.gnucash
>
> Which suggests that there should be an invoice that is missing some tag
> (or attribute), "owner".  Unfortunately, there's no line number or
> similarly helpful context to tell me what tag should be altered.  I
> found it by parsing the file with the following:
[snip]

> Which shows me this:
>
> <gnc:GncInvoice xmlns:gnc="http://www.gnucash.org/XML/gnc"
[snip]
> xmlns:vendor="http://www.gnucash.org/XML/vendor" version="2.0.0">
> <invoice:guid type="guid">6a76b4dead1c32faa8cb62c1253d2955</invoice:guid>
> <invoice:id>99999</invoice:id>
> <invoice:opened>
> <ts:date>2012-04-01 13:09:33 -0400</ts:date>
> </invoice:opened>
> <invoice:active>1</invoice:active>
> </gnc:GncInvoice>
>
> Which, indeed, does not have an owner attribute.

there should be no way in the UI to actually wind up with this object.   
Did you edit the XML by hand, or use a script to generate this?  Or
perhaps use the invoice importer?  I can't think of any way in the UI to
create an object like this.

You can see if there are any other references by doing:

grep 6a76b4dead1c32faa8cb62c1253d2955 <your data file>

This should at least show you if there are any other references to this
GUID.  If not, then you can safely just remove it.  Of course you should
back up the data file before making any changes.

> Would I be correct in assuming I could simply copy an "owner" stanza
> from another invoice into this invoice?  I actually want to *delete* the
> invoice, but I don't want to create dangling references/further
> corruption.  I believe this invoice was created when an old invoice was
> accidentally edited as a new invoice and had new line-items added.  It
> was subsequently emptied and assigned the very high invoice ID to get it
> out of the way of the "real" invoice id range (to be clear, the
> corruption occurred through actions in the GUI, not through mucking
> about with the file).

That might be sufficient, but hard to know for sure.  Take a look at your
other invoice objects to see what (else) might be missing.  Like I said, I
can't see any way to get this in the UI.

Note that if you DID do this in the UI please PLEASE file a bug report
with a recipe to generate this bogus invoice object!

> This is with GNUCash 2.4.10 built from r21973 running on Ubuntu 12.04
>
> Anyway, if someone could confirm if just adding an invoice:owner is
> reasonable, or whether it will cause issues further down the line, I
> would appreciate it,
> Mike

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins                 617-623-3745
       derek at ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant



More information about the gnucash-user mailing list