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 795082 - CSV import crashes if a transaction's 'Account' field is empty and no default Account set
CSV import crashes if a transaction's 'Account' field is empty and no default...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Import - CSV
2.7.x
Other Linux
: Normal critical
: future
Assigned To: gnucash-import-maint
gnucash-import-maint
Depends on:
Blocks:
 
 
Reported: 2018-04-08 20:56 UTC by Michael Wenyon
Modified: 2018-06-30 00:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Wenyon 2018-04-08 20:56:10 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.
Comment 1 Michael Wenyon 2018-04-08 21:07:23 UTC
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'.
Comment 2 Michael Wenyon 2018-04-08 22:25:26 UTC
And, for the record, a better mapping is

Account From --> Transfer Account
Account To --> Account
Amount (modulus) --> Deposit
Comment 3 Michael Wenyon 2018-04-09 12:04:47 UTC
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.
Comment 4 Geert Janssens 2018-04-10 17:27:09 UTC
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.
Comment 5 Geert Janssens 2018-04-14 10:42:54 UTC
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!
Comment 6 John Ralls 2018-06-30 00:07:46 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=795082. Please update any external references or bookmarks.