GNOME Bugzilla – Bug 795082
CSV import crashes if a transaction's 'Account' field is empty and no default Account set
Last modified: 2018-06-30 00:07:46 UTC
My custom-edited CSV file has the following columns (amongst others): - Account From - Account To - Amount (always a +ve number using modulus function in spreadsheet) The transactions are mixed, from and to different accounts; there is no single 'default account' common to every transaction. In the CSV import module, I map my three columns to the following Gnucash fields: - Account - Transfer Account - Withdrawal Date format is set to match my CSV (m-d-y), and my file's Description column is mapped to the same in Gnucash. In the next screen I match my account names to those I previously set up in Gnucash with the same names. I get the following error when I move to the Next screen: "An unexpected error has occured while creating transactions. Please report this as a bug. Error message: No account column selected and no default account specified either. This should never happen. Please report this as a bug." When I dismiss this error, Gnucash freezes and I invariably restart it.
I believe I have found the cause of this: a single transaction in my file with a blank 'Account' entry. On correcting this, I advance through the CSV importer to the next page with a 'List of downloaded transactions'.
And, for the record, a better mapping is Account From --> Transfer Account Account To --> Account Amount (modulus) --> Deposit
The enduring issue here is that the error message could be more helpful, for example suggesting the user ensures that no transaction line has a missing/empty 'Account' field under these circumstances.
Well the error is detected too late. It should already have been flagged on the preview page. The error you see is a fallback error, indicating we missed something while developing this. Thanks for reporting this, should be relatively easy to fix.
The test for an empty account field was there but due to a logic error it was never triggered. That is fixed now for 3.1. Thanks for your report!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=795082. Please update any external references or bookmarks.