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 535407 - QIF Import: Crash on invalid or unsupported date format
QIF Import: Crash on invalid or unsupported date format
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Import - QIF
2.2.x
Other All
: Normal critical
: ---
Assigned To: Charles Day
Derek Atkins
Depends on:
Blocks: backport
 
 
Reported: 2008-05-29 05:46 UTC by Richard Pickler
Modified: 2018-06-29 22:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample QIF file (207 bytes, text/plain)
2008-05-29 20:19 UTC, Charles Day
Details

Description Richard Pickler 2008-05-29 05:46:34 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 :)
Comment 1 Derek Atkins 2008-05-29 13:31:45 UTC
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?
Comment 2 Charles Day 2008-05-29 15:07:55 UTC
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).
Comment 3 Charles Day 2008-05-29 20:19:03 UTC
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.
Comment 4 Richard Pickler 2008-05-29 20:35:37 UTC
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.
Comment 5 Charles Day 2008-05-29 21:21:10 UTC
Fix committed as r17181. Requesting backport for 2.2.
Comment 6 Richard Pickler 2008-06-13 20:13:50 UTC
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.
Comment 7 Charles Day 2008-06-13 20:41:20 UTC
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.
Comment 8 Steve Howard 2008-07-13 01:42:02 UTC
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.
Comment 9 Charles Day 2008-07-13 02:33:31 UTC
That's definitely a bank problem. Even Quicken won't import that.
Comment 10 Andreas Köhler 2008-07-21 00:00:17 UTC
> Fix committed as r17181. Requesting backport for 2.2.
Applied to branches/2.2 as r17360 for inclusion in GnuCash 2.2.6.
Thanks!
Comment 11 John Ralls 2018-06-29 22:04:56 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=535407. Please update any external references or bookmarks.