"There was an error parsing the file..." (invoice:owner missing)
Mike C. Fletcher
mcfletch at vrplumber.com
Fri Jun 1 11:24:25 EDT 2012
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:
from lxml import etree
t = etree.fromstring( open( 'test.gnucash' ).read())
invoices = [tag for tag in t[1] if tag.tag.endswith( '}GncInvoice' )]
def has_owner( i ):
return [x for x in i if x.tag.endswith( '}owner' )]
bad = [ i for i in invoices if not has_owner( i )]
print etree.tostring( bad[0], pretty_print=True )
Which shows me this:
<gnc:GncInvoice 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" 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.
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).
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
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
More information about the gnucash-user
mailing list