Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninformative stacktrace when bug from the cut callback #232

Closed
guimarqu opened this issue May 15, 2024 · 4 comments · Fixed by #233
Closed

Uninformative stacktrace when bug from the cut callback #232

guimarqu opened this issue May 15, 2024 · 4 comments · Fixed by #233

Comments

@guimarqu
Copy link
Contributor

This throws makes very difficult to track a bug from the cut callback (at least in Pluto).

throw(model.callback_data.exception)

This is the output I got. Stack trace is misleading.
Capture d’écran 2024-05-15 à 23 13 55

I'll have to test with the Julia REPL to see if the trace is more informative.

@odow
Copy link
Member

odow commented May 15, 2024

I assume this is an indexing bug in your callback. It should give you more information from the REPL. I think I saw somewhere that Pluto mucks with the stack traces to try and make them more informative?

@guimarqu
Copy link
Contributor Author

Yes it was from my cut callback.

Not better in the Julia REPL, unfortunately.

ERROR: LoadError: UndefVarError: `bdlkq` not defined
Stacktrace:
 [1] _solve_mip_problem(model::GLPK.Optimizer)
   @ GLPK ~/.julia/packages/GLPK/wkuDA/src/MOI_wrapper/MOI_wrapper.jl:1408
 [2] optimize!(model::GLPK.Optimizer)
   @ GLPK ~/.julia/packages/GLPK/wkuDA/src/MOI_wrapper/MOI_wrapper.jl:1448
 [3] optimize!
   @ ~/.julia/packages/MathOptInterface/2rAFb/src/Bridges/bridge_optimizer.jl:380 [inlined]
 [4] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{GLPK.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
   @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/2rAFb/src/Utilities/cachingoptimizer.jl:325
 [5] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{GLPK.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
   @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/2rAFb/src/Utilities/cachingoptimizer.jl:313
 [6] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::@Kwargs{})
   @ JuMP ~/.julia/packages/JuMP/Y2NoH/src/optimizer_interface.jl:457
 [7] optimize!(model::Model)
   @ JuMP ~/.julia/packages/JuMP/Y2NoH/src/optimizer_interface.jl:409
 [8] top-level scope
   @ ~/bus_project/bus_design_project/notebooks/bus_design_preliminary_exp.jl:525
in expression starting at /Users/guimarqu/bus_project/bus_design_project/notebooks/bus_design_preliminary_exp.jl:524

line 524 is

begin
    optimize!(model)
end

This was just to let you know about this misleading stack trace.

@guimarqu guimarqu changed the title Difficult to track a bug from the cut callback (using Pluto). Uninformative stacktrace when bug from the cut callback May 15, 2024
@guimarqu
Copy link
Contributor Author

Tomorrow, I'll catch the error and try to get the "real" stack trace. I'll post the solution here and close.

@odow
Copy link
Member

odow commented May 15, 2024

I have a fix locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants