GnuCash
Contact   Instructions
Bug 798170 - Unbound variable: gnc-budget-lookup when running saved report Budget Report via gnucash-cli
Summary: Unbound variable: gnc-budget-lookup when running saved report Budget Report v...
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Reports (show other bugs)
Version: 4.5
Hardware: PC All
: Normal normal
Target Milestone: ---
Assignee: reports
QA Contact: reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-13 01:28 EDT by Jared Shields
Modified: 2021-06-12 11:17 EDT (History)
3 users (show)

See Also:


Attachments

Description Jared Shields 2021-04-13 01:28:10 EDT
Steps to recreate:
1) Open or create a book with a budget
2) Run Reports> Budget> Budget Report
3) Create a saved copy Reports> Save Report Configuration As...
4) Enter "Bug Test"
5) Open terminal/command window
6) enter ./gnucash-cli.exe -R run --name "Bug Test" "../../../Temp/bugtest.gnucash" (pointing to data file as appropriate)

Error returned:
          11 (apply-smob/1 #<catch-closure 637fe50>)
In report-core.scm:
   373:23 10 (gnc:make-report _ . _)
   304:27  9 (gnc:report-template-new-options _)
In c-interface.scm:
     77:2  8 (gnc:backtrace-if-exception _ . _)
     35:4  7 (gnc:call-with-error-handling _ _)
In ice-9/boot-9.scm:
    829:9  6 (catch #t #<procedure 8a5c3d8 at c-interface.scm:36:6 .> .)
In c-interface.scm:
    39:40  5 (_)
In ice-9/eval.scm:
    619:8  4 (_ #(#(#(#<directory (guile-user) 6363910>)) #<proce.> .))
   191:35  3 (_ #(#(#<directory (guile-user) 6363910>) #("Gener." .)))
   182:19  2 (proc #(#(#<directory (guile-user) 6363910>) #("Ge." .)))
   142:16  1 (compile-top-call _ (7 . gnc-budget-lookup) ((5 . ".") .))
In unknown file:
           0 (%resolve-variable (7 . gnc-budget-lookup) #<directory .>)

Unbound variable: gnc-budget-lookup. Did you forget (use-modules (sw_engine))?
* 23:57:14  WARN <gnc.scm>           11 (apply-smob/1 #<catch-closure 637fe50>)
In report-core.scm:
   373:23 10 (gnc:make-report _ . _)
   304:27  9 (gnc:report-template-new-options _)
In c-interface.scm:
     77:2  8 (gnc:backtrace-if-exception _ . _)
     35:4  7 (gnc:call-with-error-handling _ _)
In ice-9/boot-9.scm:
    829:9  6 (catch #t #<procedure 8a5c3d8 at c-interface.scm:36:6 â?▌> â?▌)
In c-interface.scm:
    39:40  5 (_)
In ice-9/eval.scm:
    619:8  4 (_ #(#(#(#<directory (guile-user) 6363910>)) #<proceâ?▌> â?▌))
   191:35  3 (_ #(#(#<directory (guile-user) 6363910>) #("Generâ?▌" â?▌)))
   182:19  2 (proc #(#(#<directory (guile-user) 6363910>) #("Geâ?▌" â?▌)))
   142:16  1 (compile-top-call _ (7 . gnc-budget-lookup) ((5 . "â?▌") â?▌))
In unknown file:
           0 (%resolve-variable (7 . gnc-budget-lookup) #<directory â?▌>)

Unbound variable: gnc-budget-lookup. Did you forget (use-modules (sw_engine))?
* 23:57:14  WARN <gnc.scm> BUG DETECTED: Scheme exception raised in report options generator procedure named options-gen
* 23:57:14  WARN <gnc.gui> [gnc_run_report_with_error_handling()] Error in report:            7 (apply-smob/1 #<catch-closure 637fe50>)
In c-interface.scm:
     35:4  6 (gnc:call-with-error-handling _ _)
In ice-9/boot-9.scm:
    829:9  5 (catch #t #<procedure 8d4e708 at c-interface.scm:36:6 â?▌> â?▌)
In c-interface.scm:
    39:40  4 (_)
In report-core.scm:
   747:25  3 (gnc:report-render-html #<<report> type: "810ed4b25ef0â?▌> â?▌)
In standard/budget.scm:
    677:4  2 (budget-renderer #<<report> type: "810ed4b25ef0486ea43bâ?▌>)
In options.scm:
   289:16  1 (gnc:option-value _)
    258:2  0 (gnc:option-getter _)

In procedure vector-ref: Wrong type argument in position 1 (expecting vector): #f
           7 (apply-smob/1 #<catch-closure 637fe50>)
In c-interface.scm:
     35:4  6 (gnc:call-with-error-handling _ _)
In ice-9/boot-9.scm:
    829:9  5 (catch #t #<procedure 8d4e708 at c-interface.scm:36:6 â?▌> â?▌)
In c-interface.scm:
    39:40  4 (_)
In report-core.scm:
   747:25  3 (gnc:report-render-html #<<report> type: "810ed4b25ef0â?▌> â?▌)
In standard/budget.scm:
    677:4  2 (budget-renderer #<<report> type: "810ed4b25ef0486ea43bâ?▌>)
In options.scm:
   289:16  1 (gnc:option-value _)
    258:2  0 (gnc:option-getter _)

In procedure vector-ref: Wrong type argument in position 1 (expecting vector): #f

Apparent underlying issue:
gnc-budget-lookup procedure has not been defined when the saved-reports-2.8 scheme code is loaded. Failure to return a budget object causes subsequent failures.

Workaround/fix(?):
In report-core.scm add line:
(load-and-reexport (sw_engine))
Comment 1 Christopher Lam 2021-06-12 11:17:11 EDT
Sorry for delay. This bug is confirmed, and has been fixed in maint and the upcoming release 4.6 due end of month.

I'm not sure why gnc_budget_lookup is not available when loading saved-reports-2.8, maybe it should be?

Thanks for the fantastic detective work in this.

Note You need to log in before you can comment on or make changes to this bug.