GNOME Bugzilla – Bug 464771
Investment Portfolio: Report crashes without price data
Last modified: 2018-06-29 21:45:14 UTC
Please describe the problem: Beginning with this version of GnuCash (r16304:16306 on 2007-07-16), if I select the Investment Portfolio Report I get the following error message: "Report error An error occurred while running the report." The Advanced Portfolio Report functions normally. Steps to reproduce: 1. Select Reports-Assets & Liabilities-Investment Portfolio 2. The above error message results Actual results: Only the above error message results. Expected results: I should see, and did see before this version of GnuCash, a simplified report containing my investments. Does this happen every time? Yes Other information: I am running Fedora 7 with the latest updates (I just checked and have no updates to apply at this time).
Is anything printed to the terminal or in /tmp/gnucash.trace when the error occurs?
/tmp/gnucash.trace has the following in it: * 15:09:09 WARN <gnc.engine> failed to load gnc-backend-postgres from /usr/lib/gnucash * 15:09:30 WARN <gnc.backend.file> Invalid timestamp in data file. Look for a 'trn:date-posted' entry with a date of 1969-12-31 or 1970-01-01. RLK
I received version "r16462 on 2007-08-29" last night. When I checked "Investment Portfolio Report", the error "Report error An error occurred while running the report." was still present. Advanced Portfolio Report still functions normally. /tmp/gnucash.trace now shows: "* 17:19:03 WARN <gnc.backend.file> Invalid timestamp in data file. Look for a 'trn:date-posted' entry with a date of 1969-12-31 or 1970-01-01." Would those invalid dates be present in just the portfolio data area? Why would the problem have appeared with the update to "r16304:16306 on 2007-07-16" and not before? Also, why would Advanced Portfolio Report work normally? Presumably it uses the same data file and it's timestamps, valid or invalid. Thanks, RLK
Can you please run gnucash from a terminal and include here the output generated from the report crash? There *should* be a bunch of stuff printed to the terminal window when the report crashes.
I need you to tell me the filename of the executable file to run gnucash from terminal. I searched for "gnucash" and "gnc" files, but couldn't determine what file should be executed. If you can give me the command line, I'll copy and paste it into terminal to execute gnucash. After I run gnucash from terminal, do you want the output in "/tmp/gnucash.trace"? Thanks, RLK
Sorry. It should be just "gnucash" on the assumption that Fedora installs it in a sane place in your $PATH. So open a terminal, and type: gnucash <enter> and it should just work. Gnucash should load up in the usual way. Run the report and you should see copious output on the terminal. Please cut and paste that terminal output here. If that doesn't work, you might try /usr/bin/gnucash <enter> but I don't use Fedora, so can only assume that that is where it is.
I'm sorry. I tried to make it tougher than it was. Here is the output from terminal: Found Finance::Quote version 1.13 In /usr/share/gnucash/scm/report.scm: 460: 14* [gnc:report-render-html # #t] 426: 15 (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext report) ...) 434: 16 (let ((template #) (doc #f)) (set! doc (if template # #f)) doc) 437: 17* (set! doc (if template (let* # # # ...) #f)) 437: 18* (if template (let* # # # ...) #f) 438: 19 (let* (# # # ...) (gnc:html-document-set-style-sheet! doc stylesheet) ...) 440: 20* [portfolio-renderer #] In /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm: 99: 21 (let (# #) (letrec # # #)) ... 168: 22 (let (# # # ...) (gnc:html-document-set-title! document #) ...) 190: 23* (if (not #) (let* # # # ...) (gnc:html-document-add-object! document #)) 191: 24 (let* (# # # ...) (gnc:html-table-set-col-headers! table #) ...) 234: 25* [table-add-stock-rows # # # ...] 112: 26 (let* ((share-print-info #)) (letrec (#) (set! work-to-do #) ...)) ... 136: 27 (begin # # #) 137: 28* [gnc:html-table-append-row/markup! # "alternate-row" ... 140: 29* [list #<<html-text> body: # style: #> "USD" "CURRENCY" ... ... 146: 30* [gnc:make-html-table-header-cell/markup "number-cell" ... 148: 31* [gnc:html-price-anchor #f ... 150: 32* [gnc:make-gnc-monetary ... 150: 33* [gnc-price-get-currency #f] /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: In procedure gnc-price-get-currency in expression (gnc-price-get-currency (car price-info)): /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: Wrong type argument in position 1: #f Thanks, RLK
perfect thanks! What are you setting for the Price Source option in this report? Do you have price data entered in the PriceDB (Tools->Price Editor)? I bet not... Can you try putting a price in and see if that fixes the report crash? This report as currently written doesn't support a file with no Price Entries. You'll need to enter Prices through the Price Editor. That said, it should fail gracefully instead of just crashing. retitling.
Yes, I have had data in Price Editor from my first week using GnuCash. I have data in all four fields, AMEX, NYSE, NASDAQ, and Fund. I have been using Price Editor to update my portfolio on-line for many months. I don't have problems with the GnuCash crashing, I have been unable to use the Investment Portfolio Report feature beginning with version #r16304:16306. Since upgrading to that version, I have had to use Advanced Portfolio Report instead. I get the same error message: Report error An error occurred while running the report. anytime I try using the Investment Portfolio Report feature. Again, GnuCash doesn't crash, the report feature issues the above error report instead of the report page. I am currently using version #2.2.1 r16462 on 2007-10-29. RLK
hmmm... interesting. And yes, I understand the report crashes and not the app overall. You are a victim of swigification, AFAICT. the method used to tie the reports to the main app changed in 2.2.x and it has highlighted a number of these sorts of problems. I assumed, incorrectly, that since I could get the same crash by removing the pricedb data, that this was the problem. sorry 'bout that. can you answer my other question: what Price Source option setting? also, are you willing to provide your data file for testing/debugging? thanks
Price Source option? Do you mean the location on-line where I am getting my quotes? If yes, I am using Vanguard as my Quote Source. I would not be willing to send you my data file as it is not a dummy file, but real data. It is too important to me to leave this computer. With identity theft being such a problem, I'm sure you understand my sensitivity on this issue. RLK
Run the report. crash. click the "Options" button on the toolbar. Look at the "General" tab, there is an option called "Price Source" which allows you to select one of three choices: Weighted average, most recent, nearest in time. Which of these is selected? Do you get the same behavior from the different Price Source options? I understand your desire to not share your data file, though it would help. Are there any other clues you can give that point to the problem? Can you produce a test file that causes the same behavior? I am having trouble producing the crash you describe on my system, so anything you could provide to help pinpoint this bug would be helpful. can you detail *all* the options you have selected for this report? how are your stock accounts setup? I see this interesting difference in our crashes: 140: 26* [list #<<html-text> body: # style: #> "STK1" "NYSE" ... ... mine is trying to create the html for "STK1" where yours is trying to do it for "USD". This seems odd to me and I wonder if there is some problem in your setup. Hence my questions above... 146: 27* [gnc:make-html-table-header-cell/markup "number-cell" ... 148: 28* [gnc:html-price-anchor #f ... 150: 29* [gnc:make-gnc-monetary ... 150: 30* [gnc-price-get-currency #f] /home/andrew/opt/gnucash/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: In procedure gnc-price-get-currency in expression (gnc-price-get-currency (car price-info)): /home/andrew/opt/gnucash/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: Wrong type argument in position 1: #f thanks for your continued help.
The options - General Tab -are: Report Name: Investment Portfolio Stylesheet: Default Date: Today Report Currency: USD (your STK1 above?) Price Source: Most Recent Share Decimal Places: 2 The accounts set are my Money Market, Stock, Bond, and Mutual Fund accounts. I can change Price Source to either Weighted Average or Nearest In Time, click Apply and exit the window. When I then run Investment Portfolio again, I get the same error report indicated above and Price Source has reverted to Most Recent. Even if I save the file, close GnuCash, and start GnuCash, I get the same error report and Price Source has reverted to Most Recent. I am running GnuCash from the desktop (KDE), not terminal. From terminal, here is the report: Found Finance::Quote version 1.13 In /usr/share/gnucash/scm/report.scm: 460: 11* [gnc:report-render-html # #t] 426: 12 (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext report) ...) 434: 13 (let ((template #) (doc #f)) (set! doc (if template # #f)) doc) 437: 14* (set! doc (if template (let* # # # ...) #f)) 437: 15* (if template (let* # # # ...) #f) 438: 16 (let* (# # # ...) (gnc:html-document-set-style-sheet! doc stylesheet) ...) 440: 17* [portfolio-renderer #] In /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm: 99: 18 (let (# #) (letrec # # #)) ... 168: 19 (let (# # # ...) (gnc:html-document-set-title! document #) ...) 190: 20* (if (not #) (let* # # # ...) (gnc:html-document-add-object! document #)) 191: 21 (let* (# # # ...) (gnc:html-table-set-col-headers! table #) ...) 234: 22* [table-add-stock-rows # # # ...] 112: 23 (let* ((share-print-info #)) (letrec (#) (set! work-to-do #) ...)) ... 136: 24 (begin # # #) 137: 25* [gnc:html-table-append-row/markup! # "alternate-row" ... 140: 26* [list #<<html-text> body: # style: #> "USD" "CURRENCY" ... ... 146: 27* [gnc:make-html-table-header-cell/markup "number-cell" ... 148: 28* [gnc:html-price-anchor #f ... 150: 29* [gnc:make-gnc-monetary ... 150: 30* [gnc-price-get-currency #f] /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: In procedure gnc-price-get-currency in expression (gnc-price-get-currency (car price-info)): /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: Wrong type argument in position 1: #f In /usr/share/gnucash/scm/report.scm: 460: 24* [gnc:report-render-html # #t] 426: 25 (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext report) ...) 434: 26 (let ((template #) (doc #f)) (set! doc (if template # #f)) doc) 437: 27* (set! doc (if template (let* # # # ...) #f)) 437: 28* (if template (let* # # # ...) #f) 438: 29 (let* (# # # ...) (gnc:html-document-set-style-sheet! doc stylesheet) ...) 440: 30* [portfolio-renderer #] In /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm: 99: 31 (let (# #) (letrec # # #)) ... 168: 32 (let (# # # ...) (gnc:html-document-set-title! document #) ...) 190: 33* (if (not #) (let* # # # ...) (gnc:html-document-add-object! document #)) 191: 34 (let* (# # # ...) (gnc:html-table-set-col-headers! table #) ...) 234: 35* [table-add-stock-rows # # # ...] 112: 36 (let* ((share-print-info #)) (letrec (#) (set! work-to-do #) ...)) ... 136: 37 (begin # # #) 137: 38* [gnc:html-table-append-row/markup! # "alternate-row" ... 140: 39* [list #<<html-text> body: # style: #> "USD" "CURRENCY" ... ... 146: 40* [gnc:make-html-table-header-cell/markup "number-cell" ... 148: 41* [gnc:html-price-anchor #f ... 150: 42* [gnc:make-gnc-monetary ... 150: 43* [gnc-price-get-currency #f] /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: In procedure gnc-price-get-currency in expression (gnc-price-get-currency (car price-info)): /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: Wrong type argument in position 1: #f In /usr/share/gnucash/scm/report.scm: 460: 21* [gnc:report-render-html # #t] 426: 22 (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext report) ...) 434: 23 (let ((template #) (doc #f)) (set! doc (if template # #f)) doc) 437: 24* (set! doc (if template (let* # # # ...) #f)) 437: 25* (if template (let* # # # ...) #f) 438: 26 (let* (# # # ...) (gnc:html-document-set-style-sheet! doc stylesheet) ...) 440: 27* [portfolio-renderer #] In /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm: 99: 28 (let (# #) (letrec # # #)) ... 168: 29 (let (# # # ...) (gnc:html-document-set-title! document #) ...) 190: 30* (if (not #) (let* # # # ...) (gnc:html-document-add-object! document #)) 191: 31 (let* (# # # ...) (gnc:html-table-set-col-headers! table #) ...) 234: 32* [table-add-stock-rows # # # ...] 112: 33 (let* ((share-print-info #)) (letrec (#) (set! work-to-do #) ...)) ... 136: 34 (begin # # #) 137: 35* [gnc:html-table-append-row/markup! # "alternate-row" ... 140: 36* [list #<<html-text> body: # style: #> "USD" "CURRENCY" ... ... 146: 37* [gnc:make-html-table-header-cell/markup "number-cell" ... 148: 38* [gnc:html-price-anchor #f ... 150: 39* [gnc:make-gnc-monetary ... 150: 40* [gnc-price-get-currency #f] /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: In procedure gnc-price-get-currency in expression (gnc-price-get-currency (car price-info)): /usr/share/gnucash/guile-modules/gnucash/report/portfolio.scm:150:56: Wrong type argument in position 1: #f _________________________________________________ I have the file saved with the Portfolio Report tab selected so GnuCash opens in that tab with the error report displayed. I notice one thing I maybe should mention, when I change Price Source, I get Apply and OK as well as Cancel. After selecting Apply, both Apply and OK go gray and I have to exit from the Options window using Cancel or X. I can produce a dummy data file from my personal file if I have to. It will take a bit of time as I am really busy right now with Christmas approaching. A dummy file would be a week or more off. I will do what I can to assist you with this problem. RLK
A dummy file would be great. I'm beginning to suspect, based on the data available so far, that you won't be able too... IOW, I think there may be a problem in your data file. As far as your final comments: If you just click OK instead of Apply, it will apply your changes as well as exit the window. Clicking Apply, applies the changes and then grays out the buttons because there are no new changes. This is how it should behave. This allows you to tweak the report, look at the results and tweak it again without having to reopen the Options dialog. I am happy to wait on a test file. Have a nice holiday and thanks for your continued patience.
I'd like to report that I also experience this problem in GnuCash 2.2.2, running on Windows. I am using a data file that I normally use in GnuCash on linux. I copied the file, opened it up with the Win32 version, and the Financial report does not show up, giving me also the message: "Report error An error occurred while running the report." The data file was last updated on GnuCash 2.2.1 on Linux, where the financial reports work fine. If I open the very same file in GnuCash 2.2.2 on Windows, then the financial reports do not work.
(In reply to comment #15) > "Report error > An error occurred while running the report." > > The data file was last updated on GnuCash 2.2.1 on Linux, where the financial > reports work fine. If I open the very same file in GnuCash 2.2.2 on Windows, > then the financial reports do not work. > Can you provide more details? Specifically, can you capture console output? (is that doable on windows even?) When a report crashes there is usually copious output that is helpful. We need to determine if this is a 2.2.1->2.2.2 problem or a Linux->Windows problem, or some combination of those things. Can you upgrade linux or downgrade windows to see if that helps? Thanks
I have finally built a dummy account and find that I still get the same error message when trying to get a Investment Portfolio Report. The Advanced Portfolio Report works properly. I am now using GnuCash 2.2.3 r16843 on 2008-01-08. I assume you wish me to send you this dummy account file. What do you wish me to send you? Thanks, RLK
Created attachment 103710 [details] Concole capture of investment report error
(In reply to comment #16) > Can you provide more details? Specifically, can you capture console output? (is > that doable on windows even?) When a report crashes there is usually copious > output that is helpful. > > We need to determine if this is a 2.2.1->2.2.2 problem or a Linux->Windows > problem, or some combination of those things. Can you upgrade linux or > downgrade windows to see if that helps? > > Thanks > Hello. I created an attachment (Attachment #103710 [details]) with the console output of the error I get. I captured it on Linux, Gnucash 2.2.3, (Fedora 8 release). Therefore, it seems it is not a LInux->Windows issue.
To clarify my comment #17, what file type/types should I send to you. With my edits in building this dummy account I have some 76 files totaling 300+ KB (gzip and log files) plus the "export file" feature that produces a text file. I would be surprised if you want all 76 files, but I could use Ark to bundle them if you wish. If you wish them archived, what output file format should I use? Please let me know what you wish me to send. Thanks, RLK
(In reply to comment #19) I found the cause of the problem (in my case at least) If one of the funds in my investment portfolio does not have any price entered in the price editor, then I get the message "Report error: An error occurred while running the report." when I try to generate the "Investment Portfolio" report. If all funds have a price entered for them, then the "Investment Portfolio" report works fine.
Well, I have made a change in the dummy account that resulted in the Investment Portfolio report working correctly. I had a stock in the Investment Portfolio that represented a privately held equity. As the Security General Info screen requires a "commodity" in order to complete entering the stock, I had arbitrarily selected AMEX. When I removed the stock altogether, the Investment Portfolio report displayed normally. When I made the same change in my active account (deleted the stock), the Investment Portfolio report still did not work. I don't know if providing a "commodity" option beyond AMEX/EUREX/FUND/NASDAQ/NYSE/template(?) for privately held equities would be appropriate. Then again,I probably didn't find the correct way to enter that stock. As removing it entirely didn't solve the problem, I must have another entry that is incorrect. Because I am unwilling to send you my actual account and because my dummy account now works properly, I don't think there is much more that can be done from your end. I suppose I need to study my investment entries much more closely in the hope that I can see the entry error or live with the problem. Thank you for your(and Pedro's) help. Robert L. Kief
Created attachment 104475 [details] QIF demonstrating the bug Andrew, here's a simple test file that reproduces the crash. 1. Start with gnucash --nofile 2. Import the attached QIF file. 3. Run the Investment Portfolio report.
The QIF file produces the same error message as my account file when Investment Portfolio report is run. Running Advanced Portfolio report results in the Citibank entry being displayed. RLK
Fix committed as r17430. Requesting backport for 2.2. Now if there is no price for a particular holding, a zero price is shown instead of crashing the entire report.
Applied to branches/2.2 as r17513 for inclusion in GnuCash 2.2.7. Thanks a lot!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=464771. Please update any external references or bookmarks.