GnuCash
Contact   Instructions
Bug 796983 - fails when importing QIF exported by Quicken 2015 Deluxe
Summary: fails when importing QIF exported by Quicken 2015 Deluxe
Status: NEW
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Import - QIF (show other bugs)
Version: 3.3
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: import
QA Contact: import
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-18 23:47 EST by Rick Shory
Modified: 2019-11-04 03:29 EST (History)
5 users (show)

See Also:


Attachments
example files that would and would not import, and trace file from failure (2.26 KB, application/zip)
2018-12-18 23:47 EST, Rick Shory
no flags Details
quicken transaction with corrective split (50.60 KB, image/png)
2019-04-17 06:42 EDT, Dale Phurrough
no flags Details
quicken-op-fail-workaround.png (39.74 KB, image/png)
2019-04-17 08:31 EDT, Dale Phurrough
no flags Details

Description Rick Shory 2018-12-18 23:47:52 EST
Created attachment 373079 [details]
example files that would and would not import, and trace file from failure

Quicken 2015 Deluxe:
File > Export > QIF
Quicken Account to Export from: <All Accounts>
dates: (all)
Include: Transactions, Account List, Category List, Memorized Payees, Security Lists
file created as All.QIF
GnuCash:
File > New File > New Account Hierarchy List > (Cancel)
File > Import > Import QIF > 
 Worked through the prompts, selecting 'All.QIF', accepting defaults and clicking Next.
 At step number 15, QIF Import > Start Import 
 progress bar goes about halfway, then message 'Failed'

 Retried, exporting only Transactions, and only partial date ranges.
 Some date ranges would import, others would fail.
 Example success (in attached ZIP file): 'Transactions 2018-11-23 to 30.QIF'
 Example failure: 'Transactions 2018-11-16 to 22.QIF'
 I found the trace files, but they are cryptic to me.
 The trace file from this example failure: 'gnucash.trace.C2G7TZ.log' (in attached ZIP file)
 
Other things I tried:
 Removed '/' characters from text fields in QIF file
 Removed leading '$' characters from M fields in QIF file
 Temporarily renamed (effectively delete) 'qif-accounts-map'
Comment 1 Dale Phurrough 2019-04-16 13:43:17 EDT
I have same failure experience. My trace file is almost identical with only slight differences.
My reproduces when trying to import from QIF file from Quicken 2016 and into GnuCash 3.5-1 on Windows 10.
Comment 2 Dale Phurrough 2019-04-16 13:55:53 EDT
Running 'gnucash --debug' results in a trace file with over 30k lines. Once the import starts, they are INFO lines until the fail which then has an ERROR line. Below is that ERROR line and the preceding INFO lines.

* 19:47:39  INFO <gnc.account> [xaccAccountRecomputeBalance] acct=Fidelity Smart (Cash) starting baln=0/1
* 19:47:39  INFO <gnc.engine> [trans_cleanup_commit] get rid of rollback trans=15a2e700
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=4 hi=0b6c5d10 han=6c930800 data=15a308c0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=3 hi=0bd1fca0 han=68886e12 data=15a308c0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=2 hi=0bbf4b10 han=6a0494ae data=15a308c0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=1 hi=0b83a798 han=6c90f42f data=15a308c0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=4 hi=0b6c5d10 han=6c930800 data=15a30990
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=3 hi=0bd1fca0 han=68886e12 data=15a30990
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=2 hi=0bbf4b10 han=6a0494ae data=15a30990
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=1 hi=0b83a798 han=6c90f42f data=15a30990
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=4 hi=0b6c5d10 han=6c930800 data=15a307f0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=3 hi=0bd1fca0 han=68886e12 data=15a307f0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=2 hi=0bbf4b10 han=6a0494ae data=15a307f0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=1 hi=0b83a798 han=6c90f42f data=15a307f0
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=4 hi=0b6c5d10 han=6c930800 data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=3 hi=0bd1fca0 han=68886e12 data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=2 hi=0bbf4b10 han=6a0494ae data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=1 hi=0b83a798 han=6c90f42f data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=4 hi=0b6c5d10 han=6c930800 data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=3 hi=0bd1fca0 han=68886e12 data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=2 hi=0bbf4b10 han=6a0494ae data=00000000
* 19:47:39  INFO <qof.engine> [qof_event_generate_internal] id=1 hi=0b83a798 han=6c90f42f data=00000000
* 19:47:39 ERROR <gnc.assistant> [_gfec_error_handler()] qif-import:qif-to-gnc-undo encountered an error: In ice-9/boot-9.scm:
 160: 4 [catch #t #<catch-closure e69ac50> ...]
In unknown file:
   ?: 3 [apply-smob/1 #<catch-closure e69ac50>]
In c-interface.scm:
  22: 2 [gnc:call-with-error-handling #<procedure qif-import:qif-to-gnc-undo (root)> ...]
In ice-9/boot-9.scm:
 160: 1 [catch #t #<procedure fe56768 at c-interface.scm:23:8 ()> ...]
In c-interface.scm:
  27: 0 [#<procedure fe56768 at c-interface.scm:23:8 ()>]

ERROR: In procedure apply: Apply to non-list: #f
Comment 3 Dale Phurrough 2019-04-17 06:42:33 EDT
Created attachment 373241 [details]
quicken transaction with corrective split
Comment 4 Dale Phurrough 2019-04-17 06:43:39 EDT
Discovered two things today:

1) This is a regression as compared to GnuCash 2.6.21

Using my same import file with a fresh installation of GnuCash 2.6.21, I was able to import my QIF into GnuCash 2.6.21. As a quick verification, the starting and ending balance of the one account in the QIF file was correct.

There were 4 items in the 'Unspecified' folder. Three of them were (non-split) transactions that did not have categories in Quicken 2016. The fourth was unusual. This fourth transaction was a split transaction from ~10 years ago. The transaction was the result of a memorized bill I had setup for my insurance. That memorized bill was a split transaction with 5 split lines. Ten years ago, either I or Quicken automatically entered this bill into my account register and matched it with a transaction downloaded from the bank. However, the sum of the splits IS NOT the total of the entry into the account register. Instead, there was an additional 6th split line entry that was automatically put in by Quicken to adjust the sum of the splits to match the account entry. That 6th had no category.

I have seen these adjustment split line items often in Quicken over my 10+ years using it. They can appear when working with memorized bills, making entries by hand, adjusting a transaction in the register without also adjusting the splits to sum the same, matching with a downloaded transaction, etc.

Attached (quicken transaction with corrective split) is a screenshot of that register entry and the corrective split before I added categories in (2) below.

2) Fixing all 'Unspecified' entries allowed me to import into Quicken 3.5

I saw the 4 'Unspecified' items in GnuCash 2.6.21. I then added categories for all of them in Quicken 2016 (including the corrective split). Then I exported another QIF and was able to import that QIF into Gnucash 3.5. After the import, the account starting and ending balance for the one account in the QIF was correct.
Comment 5 Dale Phurrough 2019-04-17 08:28:28 EDT
The original poster's failure example 'Transactions 2018-11-16 to 22.QIF'
SUCCESSFULLY imports into GnuCash 2.6.21
After the import there are 5 transactions in the 'Unspecified' account.

I suspect that if one or more of these 5 'Unspecified' transactions are updated in Quicken, the import would be successful in GnuCash 3.x. This may be a workaround until the regression in the GnuCash 3.x QIF import is resolved.
Comment 6 Dale Phurrough 2019-04-17 08:31:38 EDT
Created attachment 373244 [details]
quicken-op-fail-workaround.png

attached quicken-op-fail-workaround.png as a screenshot of the successfully imported QIF of the original poster and the transactions in the 'unspecified' account
Comment 7 Christopher Lam 2019-08-29 12:17:22 EDT
@Rick
Would you mind putting up a minimal QIF datafile? Ideally for the 4-split transaction dated 16-Nov-2018 ?

Please include:
* which one is your split

I'm not 100% sure the qif-importer is clever enough to handle this multisplit import.
Comment 8 Christopher Lam 2019-08-31 04:49:28 EDT
Here's an analysis of an importable transaction:

^
!Type:Cash 
D11/30'18
U245.00
T245.00
Ppaypal
M1XY42841CD4409811
L[received rent]
S[received rent]
ENov 2018 rent, half month
$187.50
S[received utilities]
ENov 2018 utilities, half month
$57.50

And here's the error transaction:
^
!Type:Bank 
D11/16'18
U50.33
T50.33
Pwireless
Mrenters shares
L[Paul Olguin]
S[Paul Olguin]
E$0.42ea/day x 30 days, 11/16 t
$12.58
S[Mike Brown]
E$0.42ea/day x 30 days, 11/16 t
$12.58
S[Benjamin Roth]
E$0.42ea/day x 30 days, 11/16 t
$12.58
S
$0.00
S
$0.00
Sadjustment
Eremaining share
$12.59

The error transaction seems to contain 6 splits - 3 to Paul/Mike/Benjamin, 1 to adjustment, and 2 blank ones. The blank splits are meant to be assigned to an "Unspecified" account. There's logic to auto-select this Unspecified account, but it's not comprehensive.

Here's a fix which allows import:

modified   gnucash/import-export/qif-imp/qif-dialog-utils.scm
@@ -578,7 +578,9 @@
                            ((and payee (= (length splits) 1))
                             (set! key-string payee))
                            (memo
-                            (set! key-string memo)))
+                            (set! key-string memo))
+                           (else
+                            (set! key-string "")))
 
                      (if key-string
                          (let ((entry (hash-ref memo-hash key-string)))

The issue is the "S [newline] $0.00" splits

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