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 795968 - "error parsing the file" after upgrading from 2.6 to 3.1
"error parsing the file" after upgrading from 2.6 to 3.1
Status: RESOLVED NOTABUG
Product: GnuCash
Classification: Other
Component: Backend - XML
3.1
Other Mac OS
: Normal normal
: future
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2018-05-09 12:02 UTC by Brian Buchalter
Modified: 2018-06-30 00:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot showing no scheduled transactions (543.46 KB, image/png)
2018-05-12 11:31 UTC, Brian Buchalter
Details

Description Brian Buchalter 2018-05-09 12:02:17 UTC
I am a macOS user and longtime Gnucash 2.6.x user. I wanted to try out the new 3.1 release, but when I attempt to open my .gnucash file, I am told there was an error parsing the file. No other information is given and the file does not open.
Comment 1 John Ralls 2018-05-09 13:45:14 UTC
Please open Applications:Utilities:Terminal (also in the Launchpad under Utilities). At the prompt enter
  /Applications/Gnucash.app/Contentes/MacOS/Gnucash --debug --extra /path/to/foo.gnucash
making the obvious substitution and adjusting the path to GnuCash if you installed it somewhere other than the Applications folder or have changed the name. 

After GnuCash has failed to open your file, dismiss the dialog and quit GnuCash. Find the trace file [1] and attach it to this report. Copy any output from the Terminal window and paste it into a comment.

[1] https://wiki.gnucash.org/wiki/Tracefile
Comment 2 Brian Buchalter 2018-05-09 13:51:59 UTC
```
➜  ~ /Applications/Gnucash.app/Contents/MacOS/Gnucash --debug --extra ~/Google\ Drive\ \(bal711@gmail.com\)/Financials/GnuCash/buchalter.gnucash
Application Path /Applications/Gnucash.app/Contents/MacOS/Gnucash

(process:75426): gnc.gui-WARNING **: [mac_set_languages()] Language list: en:en_US:C
➜  ~
```

New trace file attached.
Comment 3 Brian Buchalter 2018-05-09 13:53:12 UTC
Trace file too big. Hosted here instead: https://drive.google.com/file/d/1pUakdnFZWFq5hByYb4s3iQgDzhibOH_K/view?usp=sharing
Comment 4 John Ralls 2018-05-10 04:56:51 UTC
There are two errors reported in the file. One is that a transaction has a date of 216-01-19. That's no doubt supposed to be 2016-01-19. I can't tell from the output what account it's in but you should be able to find it using Edit>Find (or command-F) with the file open in 2.6.x and I imagine you'd want to fix it regardless. The second is a rather unhelpful "syntax error in file...". That's immediately after freeing the splits for the template root, so it's possible that there's a bad scheduled transaction. Check those over as well. The scheduled transaction editor was tightened up somewhere around 2.6.12 (two years ago, memory of exactly when is fading) so if you're using 2.6.19 or 2.6.21 and edit each scheduled transaction in turn it should raise error dialogs if anything is messed up.

Please fix the date first and then try to load. If it still fails then look at the scheduled transactions; we'd like GnuCash to be more robust in the face of errors and need to know what's stopping the load in order to fix the right thing.
Comment 5 Brian Buchalter 2018-05-12 11:30:43 UTC
John, first thanks for your quick and helpful guidance. Sadly the issue is not resolved. I did find and correct the transaction with the invalid date (although Edit>Find did not help, I scanned each account manually). I also scanned for other obviously invalid dates and found none. Additionally, I verified there are no scheduled transactions listed (screenshot attached). I've taken a fresh trace and made it available here: https://drive.google.com/file/d/1pUakdnFZWFq5hByYb4s3iQgDzhibOH_K/view?usp=sharing

If you would please be so kind as to take another look, I would greatly appreciate it.
Comment 6 Brian Buchalter 2018-05-12 11:31:16 UTC
Created attachment 371952 [details]
screenshot showing no scheduled transactions
Comment 7 Brian Buchalter 2018-05-12 11:48:46 UTC
After inspecting the trace myself I was able to see that the transaction which had the invalid date was for a "commodity" which caused the same invalid date to be entered into the Price Editor. Correcting that has resolved the problem. :heart:

Thanks again John for your help and all you do to keep GnuCash alive. I am deeply grateful! Have a beautiful Saturday.
Comment 8 John Ralls 2018-06-30 00:09:42 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=795968. Please update any external references or bookmarks.