GNOME Bugzilla – Bug 535407
QIF Import: Crash on invalid or unsupported date format
Last modified: 2018-06-29 22:04:56 UTC
Steps to reproduce: 1. File->Import->Import QIF 2. Set the file path in the appropriate field 3. Click Forward Boom! Stack trace: This is spit out when running from a shell: Backtrace: In /usr/share/gnucash/scm/qif-import/qif-file.scm: 626: 3* [check-and-parse-field #<procedure qif-xtn:date #> ...] 719: 4 (let (# # #) (if # #) (cond # # #) ...) 724: 5* (if (not (null? objects)) (letrec (#) (loop # #))) 725: 6 (letrec ((loop (lambda # # #))) (loop (car objects) (cdr objects))) ... 735: 7 [loop # #] 727: 8* (let ((val #)) (if val (begin # #))) 728: 9 (if val (begin (set! do-parsing #t) (set! formats (checker val formats)))) ... 731: 10 (set! formats (checker val formats)) 731: 11* [qif-parse:check-date-format "4/18/08" #f] In /usr/share/gnucash/scm/qif-import/qif-parse.scm: 395: 12 (let ((retval #f)) (if (or # #) (set! retval possible-formats)) ...) 399: 13* (let ((match #)) (if match (if # # #))) 400: 14 (if match (if (match:substring match 1) (set! retval #) (let* # # # ...))) ... 402: 15 (set! retval (parse-check-date-format match possible-formats)) 402: 16* [parse-check-date-format #("4/18/08" (0 . 7) (0 . 1) ...) #f] 315: 17 (let (# # #) (set! numeric-date-parts #) (let # # # ...) ...) 334: 18* (let (# # # # ...) (if # #) (if # #) ...) 352: 19* (if (or # #) (begin # #)) 353: 20 (begin (set! possibilities #) (set! possibilities #)) 354: 21* (set! possibilities (delq (quote d-m-y) possibilities)) 354: 22* [delq d-m-y #f] /usr/share/gnucash/scm/qif-import/qif-parse.scm:354:33: In procedure list-copy in expression (delq (quote d-m-y) possibilities): /usr/share/gnucash/scm/qif-import/qif-parse.scm:354:33: Wrong type argument in position 1: #f Other information: If the file is needed, then I will see if I can provide you with something that doesn't contain a ton of my personal information :)
There have been a lot of updates to the QIF importer. 2.2.5 is the current release. Can you still reproduce this in 2.2.5?
Two questions: 1. When this happened, what did you see besides the backtrace? Did you receive any other indication that something went wrong, like an error message in the GUI? Or did GnuCash just crash? 2. In your QIF file there are lines starting with 'D' that are supposed to contain dates. Somewhere in your QIF file there is a line containing "D4/18/08". Hopefully there is only one line like this. Could you please find that line, then find the 'D' lines that appear BEFORE and AFTER "D4/18/08" and tell me what appears in them? I suspect you have a non-date there, or at least a non-numeric date ("June 1, 2007" for example).
Created attachment 111762 [details] Sample QIF file I can reproduce this problem in 2.2.5 with the attached sample QIF file. I'll soon submit a fix so that an error message pops up instead of it simply crashing. However, there's still something wrong with a date in your QIF file, I believe, you may have to fix that yourself. Please refer to question 2 above, and also please upgrade to 2.2.5 before doing any more QIF importing, because 2.2.5 includes fixes for many other QIF bugs.
Sorry for not responding today. I'm currently at work, so I cannot answer your questions until I get home (late) tonight. I honestly wasn't expecting a response this quick :) As for the version I'm running, I will put a bug into launchpad to hopefully have them update their packages when this is resolved. I'm just running what Ubuntu gives me, which is 2.2.4.
Fix committed as r17181. Requesting backport for 2.2.
Went through the QIF File and found this: D1/01/,)/- T-13.99 N PNFI*WWW.NETFLIX.COM/CC So, yeah, There's something wrong there. I'll submit a bug to the bank account I got this from. Guess this can be closed out.
Wow, that's a strange one. Well, we will still keep this open until the patch gets backported. At least that will stop the crashing behavior.
FYI, I ran into the same problem. The entries with the D1/01/,)/- line are for "pending" entries, which I guess are transactions made recently that haven't gone through the system yet or something. Thought that might be useful to someone.
That's definitely a bank problem. Even Quicken won't import that.
> Fix committed as r17181. Requesting backport for 2.2. Applied to branches/2.2 as r17360 for inclusion in GnuCash 2.2.6. Thanks!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=535407. Please update any external references or bookmarks.