GNOME Bugzilla – Bug 765846
Expense Over Time for subaccounts: An error occurred while running the report.
Last modified: 2018-06-29 23:48:50 UTC
When I try to generate the report "Expense Over Time" for a subaccount (i.e. an account with no further childs), I get an error message. The console shows the following: [...] ;;; WARNING (gnc:get-commodity-totalavg-prices: Sorry, currency exchange not yet implemented: SFr.3.20 (buying ???2.62 ) =? $0.00) ;;; WARNING (gnc:get-commodity-totalavg-prices: Sorry, currency exchange not yet implemented: kn240.00 (buying ???30.00 ) =? $0.00) In ice-9/boot-9.scm: 171: 19 [with-throw-handler #t #<catch-closure 466fa80> #<catch-closure 466fa60>] In unknown file: ?: 18 [apply-smob/1 #<catch-closure 466fa80>] ?: 17 [call-with-input-string "(gnc:report-run 0)" ...] In ice-9/boot-9.scm: 2401: 16 [save-module-excursion #<procedure 462c360 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 15 [read-and-eval #<input: string 466d4e0> #:lang ...] 37: 14 [lp (gnc:report-run 0)] In report.scm: 753: 13 [gnc:report-run 0] In ice-9/boot-9.scm: 157: 12 [catch ignore #<procedure 462c150 at main.scm:116:4 ()> ...] In unknown file: ?: 11 [lazy-catch #t #<procedure 462c0f0 at main.scm:118:18 ()> ...] In ice-9/boot-9.scm: 171: 10 [with-throw-handler #t #<catch-closure 466f760> #<catch-closure 466f740>] In unknown file: ?: 9 [apply-smob/1 #<catch-closure 466f760>] In report.scm: 757: 8 [#<procedure 462c180 at report.scm:754:5 ()>] 728: 7 [gnc:report-render-html # #t] In category-barchart.scm: 422: 6 [category-barchart-renderer # "Expense Over Time" ...] 371: 5 [calculate-report (#<swig-pointer Account * 2d67e40>) (0 . 90)] In report-collectors.scm: 142: 4 [category-by-account-report-work #t ((# # ()) (# # ()) (# # ()) ...) ...] 89: 3 [build-account-collector () ...] In collectors.scm: 105: 2 [make-slotset #<procedure 47f1d20 at collectors.scm:135:16 (v)> ()] In ice-9/boot-9.scm: 102: 1 [#<procedure 3394d80 at ice-9/boot-9.scm:97:6 (thrown-k . args)> not-a-list ...] In unknown file: ?: 0 [apply-smob/1 #<catch-closure 466f740> not-a-list ()]
I got the same problem with 2.6.13.
Hi, I tried to reproduce this issue using the Expense Barchart report, but did not succeed - GnuCash 2.6.14 Can you describe in more detail how to reproduce this issue? Can you attach a test gnucash file with which to reproduce the issue?
I was able to repro after upgrading to 2.6.14. It needs to be an account at level 3 (for example, Expenses -> Car -> Gas).
I can reproduce this issue by if I do not change the default settings for the option "Show Accounts until level", which is 2 by default. After changing this option to e.g. "All" the report works as expected. Is this the same for you?
I can confirm that changing the option to "All" removes the error and the report is displayed as expected.
Fixed in https://github.com/Gnucash/gnucash/commit/83a313ff8670a8979b34c00453d4cb338ab28277 This bug can now be closed.
Chris, as this bug was reported against 2.6.12 can you also provide a PR to fix it on maint ?
Ok, I have just pushed Chris' patch to maint as well. Thanks! This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.
Unfortunately the commit 51e2511223eb0873f342f0153929ef53d849d0eb breaks the "Asset Barchart" report on maint, at least here in my installation. The commit before will run fine, but with this commit, the "Asset Barchart" report crashes ("There was a problem creating this report") with this console scheme backtrace: 732: 18* [#<procedure #f #> #] In /home/cs/usr-maint/share/gnucash/scm/gnucash/report/standard-reports/category-barchart.scm: 691: 19 [category-barchart-renderer # "Assets Over Time" ...] In unknown file: ... ?: 20 (letrec (# # #) (if # # #) (gnc:report-finished) ...) In /home/cs/usr-maint/share/gnucash/scm/gnucash/report/standard-reports/category-barchart.scm: 272: 21* [account-destination-alist (# # # # ...) (2 0 1 15 ...) ... /home/cs/usr-maint/share/gnucash/scm/gnucash/report/standard-reports/category-barchart.scm:272:7: While evaluating arguments to account-destination-alist in expression (account-destination-alist accounts account-types ...): /home/cs/usr-maint/share/gnucash/scm/gnucash/report/standard-reports/category-barchart.scm:272:7: Variable used before given a value: tree-depth
This backtrace appeared regardless of the "Show Accounts until level" setting, both for the default value "2" and also when manually choosing "All" or any other value.
That's odd as the commit defines tree-depth immediately above its invocation. Usually we'd say to make sure that the guile caches are cleared, but given that it's all from one commit it's hard to imagine a scenario where you could get one without the other. I just tested with 2.7.8, no problem.
Please check guile version as well. If I understand this right, guile 2.0 onwards support r6rs in which (define (overarching-function) (define x 'a) (define y x)) In R6RS, x is accessible to y; in r5rs it wasn't. I'm not a guile guru; I started hacking with guile 2.0 and never coped with the struggles of guile pre-2.0.
Hi, after upgrading from GnuCash 2.6.19 to 2.6.21 all my "Expense Barchart" / "Expense Over Time" reports stopped working and and fail with "Report error. An error occurred while running the report.". This includes changing account levels / resetting the reports to default settings, creating new reports and even creating a new empty GnuCash file. Reviewing the .20 and .21 changelogs, this seems to be the only related change.
I'm afraid this was my commit. 2.6.21 should be the last 2.6.xx release which still uses guile-1.8. This bug should be fixable by amending category-barchart.scm lines 271-272 to the following: (define the-acount-destination-alist (account-destination-alist accounts account-types (if (equal? account-levels 'all) (gnc:get-current-account-tree-depth) account-levels))) This can be changed in the installed Gnucash directory. I haven't submitted a pull request for the 2.6 series; unless there are any other critical bugs in 2.6.21, I understand there will be no further release. When Gnucash is upgraded to 3.0 which uses guile-2.0, category-barchart.scm will work correctly.
This helped, thank you.
Thanks, the described lines fixed it for me, too. I committed this in a new "branch-2.6" branch, a76c1060130dba450479c2eff220e04a6b228808, so that people who are stuck on the old code (such as me) are still able to use the features in the old version. This might be a candidate for another 2.6.22 release at whatever point in the future, who knows. 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=765846. Please update any external references or bookmarks.