GNOME Bugzilla – Bug 796696
Trial balance and Equity report after upgrade to 3.2
Last modified: 2018-06-30 00:12:31 UTC
After upgrading from 3.1-2 (Installed May 16, 2018) to 3.2 installed today (June 27, 2018) I am greeted with the following error when asking for a trial balance: Report error An error occurred while running the report. Trial Balance previously ran well. I also noticed that the equity report has the same problem. This issue was first noticed today when I installed Gnucash 3.2 on my new accountants machine. He had the problem. I then upgraded my installation and found I had the exact same problem. I used my live business account in both instances. Please don't ask me to share my personal business info with you. That makes me uncomfortable. Thanks Dan
*** Bug 796697 has been marked as a duplicate of this bug. ***
I suppose reporting this twice was by accident ? We don't need your personal business information at this point (and probably never). But you can supply us with the trace file that was generated when trying to run the report. http://wiki.gnucash.org/wiki/Tracefile will tell you how to obtain this trace file.
Sorry I took so long in responding. I didn't realize the tracefile wouldn't be generated until after GnuCash was closed. Yes the duplicate was an accident. I see no way to attach the file so I will copy and past it here: --------------------------- 8< --------------------- * 12:35:39 WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (No such file or directory) * 12:35:40 WARN <gnc.scm> In unknown file: ?: 19 [apply-smob/1 #<catch-closure ddffc50>] In c-interface.scm: 22: 18 [gnc:call-with-error-handling "(gnc:report-run 0)" ()] In ice-9/boot-9.scm: 160: 17 [catch #t #<procedure f6b9978 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 16 [#<procedure f6b9978 at c-interface.scm:23:8 ()>] In unknown file: ?: 15 [eval-string "(gnc:report-run 0)" #<undefined>] ?: 14 [call-with-input-string "(gnc:report-run 0)" ...] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #<procedure f6b9930 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 12 [read-and-eval #<input: string ee1a2a0> #:lang ...] 37: 11 [lp (gnc:report-run 0)] In report.scm: 833: 10 [gnc:report-run 0] In c-interface.scm: 70: 9 [gnc:backtrace-if-exception #<procedure f6b9828 at report.scm:834:5 ()>] 22: 8 [gnc:call-with-error-handling #<procedure f6b9828 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 7 [catch #t #<procedure f6b9810 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 6 [#<procedure f6b9810 at c-interface.scm:23:8 ()>] In report.scm: 837: 5 [#<procedure f6b9828 at report.scm:834:5 ()>] 808: 4 [gnc:report-render-html # #t] In trial-balance.scm: 828: 3 [trial-balance-renderer # #f #f] 451: 2 [add-line # # ...] In html-acct-table.scm: 1114: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [make-list -1/2 #f] ERROR: Wrong type (expecting exact integer): -1/2 * 12:36:13 WARN <gnc.core-utils> Could not locate file AUTHORS * 12:36:13 WARN <gnc.core-utils> Could not locate file DOCUMENTERS * 12:36:13 WARN <gnc.core-utils> Could not locate file LICENSE * 12:36:29 WARN <gnc.scm> In unknown file: ?: 19 [apply-smob/1 #<catch-closure ddffc50>] In c-interface.scm: 22: 18 [gnc:call-with-error-handling "(gnc:report-run 0)" ()] In ice-9/boot-9.scm: 160: 17 [catch #t #<procedure f36c4f8 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 16 [#<procedure f36c4f8 at c-interface.scm:23:8 ()>] In unknown file: ?: 15 [eval-string "(gnc:report-run 0)" #<undefined>] ?: 14 [call-with-input-string "(gnc:report-run 0)" ...] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #<procedure f36c498 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 12 [read-and-eval #<input: string e988e70> #:lang ...] 37: 11 [lp (gnc:report-run 0)] In report.scm: 833: 10 [gnc:report-run 0] In c-interface.scm: 70: 9 [gnc:backtrace-if-exception #<procedure f36c3a8 at report.scm:834:5 ()>] 22: 8 [gnc:call-with-error-handling #<procedure f36c3a8 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 7 [catch #t #<procedure f36c390 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 6 [#<procedure f36c390 at c-interface.scm:23:8 ()>] In report.scm: 837: 5 [#<procedure f36c3a8 at report.scm:834:5 ()>] 808: 4 [gnc:report-render-html # #t] In trial-balance.scm: 828: 3 [trial-balance-renderer # #f #f] 451: 2 [add-line # # ...] In html-acct-table.scm: 1114: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [make-list -1/2 #f] ERROR: Wrong type (expecting exact integer): -1/2 * 12:51:50 WARN <gnc.scm> In unknown file: ?: 19 [apply-smob/1 #<catch-closure ddffc50>] In c-interface.scm: 22: 18 [gnc:call-with-error-handling "(gnc:report-run 1)" ()] In ice-9/boot-9.scm: 160: 17 [catch #t #<procedure e362eb8 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 16 [#<procedure e362eb8 at c-interface.scm:23:8 ()>] In unknown file: ?: 15 [eval-string "(gnc:report-run 1)" #<undefined>] ?: 14 [call-with-input-string "(gnc:report-run 1)" ...] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #<procedure e362e70 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 12 [read-and-eval #<input: string f95bc40> #:lang ...] 37: 11 [lp (gnc:report-run 1)] In report.scm: 833: 10 [gnc:report-run 1] In c-interface.scm: 70: 9 [gnc:backtrace-if-exception #<procedure e362d68 at report.scm:834:5 ()>] 22: 8 [gnc:call-with-error-handling #<procedure e362d68 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 7 [catch #t #<procedure e362d50 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 6 [#<procedure e362d50 at c-interface.scm:23:8 ()>] In report.scm: 837: 5 [#<procedure e362d68 at report.scm:834:5 ()>] 808: 4 [gnc:report-render-html # #t] In trial-balance.scm: 828: 3 [trial-balance-renderer # #f #f] 451: 2 [add-line # # ...] In html-acct-table.scm: 1114: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [make-list -1/2 #f] ERROR: Wrong type (expecting exact integer): -1/2 * 12:51:59 WARN <gnc.scm> In ice-9/boot-9.scm: 160: 19 [catch #t #<catch-closure ddffc50> ...] In unknown file: ?: 18 [apply-smob/1 #<catch-closure ddffc50>] In c-interface.scm: 22: 17 [gnc:call-with-error-handling "(gnc:report-run 2)" ()] In ice-9/boot-9.scm: 160: 16 [catch #t #<procedure f869e58 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 15 [#<procedure f869e58 at c-interface.scm:23:8 ()>] In unknown file: ?: 14 [eval-string "(gnc:report-run 2)" #<undefined>] ?: 13 [call-with-input-string "(gnc:report-run 2)" ...] In ice-9/boot-9.scm: 2412: 12 [save-module-excursion #<procedure f869e10 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 11 [read-and-eval #<input: string f95b000> #:lang ...] 37: 10 [lp (gnc:report-run 2)] In report.scm: 833: 9 [gnc:report-run 2] In c-interface.scm: 70: 8 [gnc:backtrace-if-exception #<procedure f869d08 at report.scm:834:5 ()>] 22: 7 [gnc:call-with-error-handling #<procedure f869d08 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 6 [catch #t #<procedure f869cf0 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 5 [#<procedure f869cf0 at c-interface.scm:23:8 ()>] In report.scm: 837: 4 [#<procedure f869d08 at report.scm:834:5 ()>] 808: 3 [gnc:report-render-html # #t] In equity-statement.scm: 582: 2 [equity-statement-renderer # #f #f] In html-acct-table.scm: 1114: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [make-list 1/2 #f] ERROR: Wrong type (expecting exact integer): 1/2 * 13:16:20 WARN <gnc.scm> In unknown file: ?: 19 [apply-smob/1 #<catch-closure ddffc50>] In c-interface.scm: 22: 18 [gnc:call-with-error-handling "(gnc:report-run 4)" ()] In ice-9/boot-9.scm: 160: 17 [catch #t #<procedure f5e7060 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 16 [#<procedure f5e7060 at c-interface.scm:23:8 ()>] In unknown file: ?: 15 [eval-string "(gnc:report-run 4)" #<undefined>] ?: 14 [call-with-input-string "(gnc:report-run 4)" ...] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #<procedure f5e7018 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 12 [read-and-eval #<input: string dac4310> #:lang ...] 37: 11 [lp (gnc:report-run 4)] In report.scm: 833: 10 [gnc:report-run 4] In c-interface.scm: 70: 9 [gnc:backtrace-if-exception #<procedure f5f1f00 at report.scm:834:5 ()>] 22: 8 [gnc:call-with-error-handling #<procedure f5f1f00 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 7 [catch #t #<procedure f5f1ee8 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 6 [#<procedure f5f1ee8 at c-interface.scm:23:8 ()>] In report.scm: 837: 5 [#<procedure f5f1f00 at report.scm:834:5 ()>] 808: 4 [gnc:report-render-html # #t] In trial-balance.scm: 828: 3 [trial-balance-renderer # #f #f] 451: 2 [add-line # # ...] In html-acct-table.scm: 1114: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [make-list -1/2 #f] ERROR: Wrong type (expecting exact integer): -1/2 ------------------------ >8 ---------------------- I envy you. I love C++, Bjarne Stroustrup is my hero but I Despise C++ string handling. Let me know what else I can do. Thanks, Dan
try amend html-acct-table.scm line 1114 from (+ (- amt-depth (/ tbl-width 2)) to (+ (- amt-depth (ceiling (/ tbl-width 2))) this may cause misalignment issues but could prevent crashing
I made the change you suggested. In Notepad++ line 1115 was the only line that matched your "from" line so I felt comfortable making the changes as you suggested but the problem persists. Just in case you need it, here is the latest trace file with the changes you suggested in effect: -------------------------------- 8< -------------------------- * 00:23:36 WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (No such file or directory) * 00:23:53 WARN <gnc.scm> In unknown file: ?: 19 [apply-smob/1 #<catch-closure d4c4c50>] In c-interface.scm: 22: 18 [gnc:call-with-error-handling "(gnc:report-run 0)" ()] In ice-9/boot-9.scm: 160: 17 [catch #t #<procedure e163450 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 16 [#<procedure e163450 at c-interface.scm:23:8 ()>] In unknown file: ?: 15 [eval-string "(gnc:report-run 0)" #<undefined>] ?: 14 [call-with-input-string "(gnc:report-run 0)" ...] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #<procedure e163408 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 12 [read-and-eval #<input: string db8ba10> #:lang ...] 37: 11 [lp (gnc:report-run 0)] In report.scm: 833: 10 [gnc:report-run 0] In c-interface.scm: 70: 9 [gnc:backtrace-if-exception #<procedure e163300 at report.scm:834:5 ()>] 22: 8 [gnc:call-with-error-handling #<procedure e163300 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 7 [catch #t #<procedure e1632e8 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 6 [#<procedure e1632e8 at c-interface.scm:23:8 ()>] In report.scm: 837: 5 [#<procedure e163300 at report.scm:834:5 ()>] 808: 4 [gnc:report-render-html # #t] In trial-balance.scm: 828: 3 [trial-balance-renderer # #f #f] 451: 2 [add-line # # ...] In html-acct-table.scm: 1114: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [make-list -1 #f] ERROR: Value out of range 0 to 4294967295: -1 ------------------------------- >8 --------------------------- Sorry for the tardy response. We normally close at 2200 hrs UTC. I am in the eastern time zone in the US. (UTC-4) Thanks for your help. Dan Dan
Hmm nearly there... try the opposite! Try: (+ (- amt-depth (floor (/ tbl-width 2)))
Kudos young man! It works! For the record, I am noticing unmistakable albeit minor whitespace padding issues in the Trial Balance report. I did not do an exhaustive search for further issues but for now, I am happy. The issue is temporarily resolved and you will probably want the development group to take a look at the padding issues. It would be a shame to have such an elegant piece of software produce a substandard report. Thanks for all your help here and again kudos. Well done! Dan
Bad news. The patch failed on my accountant's computer. Here is his trace file. ----------------------------- 8< ------------------------ * 11:51:16 WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (No such file or directory) * 11:51:31 WARN <gnc.scm> In unknown file: ?: 19 [apply-smob/1 #<catch-closure f15ac50>] In c-interface.scm: 22: 18 [gnc:call-with-error-handling "(gnc:report-run 0)" ()] In ice-9/boot-9.scm: 160: 17 [catch #t #<procedure 10bb8f48 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 29: 16 [#<procedure 10bb8f48 at c-interface.scm:23:8 ()>] In unknown file: ?: 15 [eval-string "(gnc:report-run 0)" #<undefined>] ?: 14 [call-with-input-string "(gnc:report-run 0)" ...] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #<procedure 10bb8f00 at ice-9/eval-string.scm:65:9 ()>] In ice-9/eval-string.scm: 44: 12 [read-and-eval #<input: string 10a31bd0> #:lang ...] 37: 11 [lp (gnc:report-run 0)] In report.scm: 833: 10 [gnc:report-run 0] In c-interface.scm: 70: 9 [gnc:backtrace-if-exception #<procedure 10bb8e10 at report.scm:834:5 ()>] 22: 8 [gnc:call-with-error-handling #<procedure 10bb8e10 at report.scm:834:5 ()> ...] In ice-9/boot-9.scm: 160: 7 [catch #t #<procedure 10bb8df8 at c-interface.scm:23:8 ()> ...] In c-interface.scm: 27: 6 [#<procedure 10bb8df8 at c-interface.scm:23:8 ()>] In report.scm: 837: 5 [#<procedure 10bb8e10 at report.scm:834:5 ()>] 808: 4 [gnc:report-render-html # #t] In trial-balance.scm: 828: 3 [trial-balance-renderer # #f #f] 451: 2 [add-line # # ...] In html-acct-table.scm: 1115: 1 [gnc:html-table-add-labeled-amount-line! # 3 "primary-subheading" ...] In unknown file: ?: 0 [floor #<procedure / (#:optional _ _ . _)> 3 2] ERROR: Wrong number of arguments to #<procedure floor (_)> -------------------------------- >8 ------------------------ Dan
There's probably a ( missing before the / Or: You can restore the html-utilities.scm to undo the change causing this bug: Near the top: FROM: (define (gnc:html-make-empty-cells n) (make-list n #f)) TO: (define (gnc:html-make-empty-cells n) (if (> n 0) (cons #f (gnc:html-make-empty-cells (- n 1))) (list)))
Oh I forgot to mention the html-utilities change has been done in the tree which means v3.3 will not display this error. The error stems from the fact that html-acct-table is written IMHO sloppily - it has numerous hacks that make many assumptions. There's a newer html-acct-table in development, and can support multiple columns -- it'll be called html-multicolumn-acct-table. It can be applied to the Balance sheet, Income Statement, Budget Cash flow etc. but this will definitely take some time to convert safely. I will definitely ensure more test cases are written to prevent further regression. The sloppy full function definition in html-acct-table.scm is: (gnc:html-make-empty-cells ;; padding after label (+ (- amt-depth (/ tbl-width 2)) (if total-rule? -1 0) ) ) in this case, tbl-width was an odd number, causing its (/) division by 2 to become something like 1/2; and amt-depth was a small number; and their (-) difference was -1/2. The previous (gnc:html-make-empty-cells) was written to accept these negative half numbers and outputting an empty list. See the comparison (> n 0) which tests n for positivity to build the #f list and iterate with (n-1), or return empty list if n <= 0. Its definition was amended in v3.2 to use an efficient but concise (make-list n #f) which unfortunately accepts zero or positive integers only. So, for now the concise code has been reverted and will be fixed in v3.3. Meanwhile if you're comfortable fixing html-utilities.scm as above I'm sure the reports will run as before.
Hi Chris, Re: Comment # 9 Here is the bottom line as a result of your comments #9 & #10. I restored html-acct-table.scm line 1115 to read (+ (- amt-depth (/ tbl-width 2)) This is the way 3.2 was shipped. I modified html-utilities.scm as follows. Lines 28 and up to the next blank line now read (define (gnc:html-make-empty-cell) #f) (define (gnc:html-make-empty-cells n) (if (> n 0) (cons #f (gnc:html-make-empty-cells (- n 1))) (list))) The changes worked on my machine. I will test them on my accountant's machine and report the results here. I should have something to tell you by Monday, perhaps earlier. I work 0900 to 1800 UTC-4 OBTW, I wouldn't be too critical of the sloppy code. I've made the same kind of dumb bunny errors after a full day of converting caffeine to code and 4 hours after I should have gone to bed and I am pedantic about my code. Have a good weekend. Dan
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=796696. Please continue processing the bug there and please update any external references or bookmarks.