GnuCash
Contact   Instructions
Bug 795082 - CSV import crashes if a transaction's 'Account' field is empty and no default Account set
Summary: CSV import crashes if a transaction's 'Account' field is empty and no default...
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Import - CSV (show other bugs)
Version: 2.7.x
Hardware: Other Linux
: Normal critical
Target Milestone: future
Assignee: import
QA Contact: import
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-08 16:56 EDT by Michael Wenyon
Modified: 2018-04-14 06:42 EDT (History)
3 users (show)

See Also:


Attachments

Description Michael Wenyon 2018-04-08 16:56:14 EDT
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 17:07:27 EDT
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 18:25:30 EDT
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 08:04:51 EDT
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 13:27:13 EDT
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 06:42:58 EDT
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!

Note You need to log in before you can comment on or make changes to this bug.