# JuMP 0.20.1: Possible bug in CPLEX when using generic lazy callback

**URL:** <https://discourse.julialang.org/t/jump-0-20-1-possible-bug-in-cplex-when-using-generic-lazy-callback/35425>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [March 2, 2020, 7:16pm UTC](https://discourse.julialang.org/t/jump-0-20-1-possible-bug-in-cplex-when-using-generic-lazy-callback/35425 "2020-03-02T19:16:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryancorywright](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@ryancorywright](https://discourse.julialang.org/u/ryancorywright)\
**Post date:** [March 2, 2020, 7:16pm UTC](https://discourse.julialang.org/t/jump-0-20-1-possible-bug-in-cplex-when-using-generic-lazy-callback/35425/1 "2020-03-02T19:16:01Z")

</div>

Specs: JuMP version 0.20.1, MOI version 0.9.12, CPLEX version 12.10, CPLEX.jl version 0.6.3.

When using JuMP and CPLEX to solve a problem via outer approximation (using a generic lazy callback), I’m getting the following error at the first _fractional_ node the callback is called at (the callback works fine the first 5-6 times its called at strictly integral points).

> CPLEX Error 1811: Attempt to invoke unsupported operation…  
> Got exception outside of a @test  
> CPLEX.CplexError(1811, “CPLEX Error 1811: Attempt to invoke unsupported operation…\n”)  
> Stacktrace:  
> [1] return\_status\_or\_throw at /Users/ryangeorgecory-wright/.julia/packages/CPLEX/VVr3o/src/cpx\_generic\_callbacks.jl:24 [inlined]  
> [2] cbrejectcandidate(::CPLEX.CallbackContext, ::Int32, ::Int32, ::Array{Float64,1}, ::Array{Int8,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Array{Float64,1}) at /Users/ryangeorgecory-wright/.julia/packages/CPLEX/VVr3o/src/cpx\_generic\_callbacks.jl:161  
> [3] submit(::CPLEX.Optimizer, ::MathOptInterface.LazyConstraint{CPLEX.CallbackContext}, ::MathOptInterface.ScalarAffineFunction{Float64}, ::MathOptInterface.LessThan{Float64}) at /Users/ryangeorgecory-wright/.julia/packages/CPLEX/VVr3o/src/MOI/MOI\_callbacks.jl:142  
> [4] submit(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer}, ::MathOptInterface.LazyConstraint{CPLEX.CallbackContext}, ::MathOptInterface.ScalarAffineFunction{Float64}, ::MathOptInterface.LessThan{Float64}) at /Users/ryangeorgecory-wright/.julia/packages/MathOptInterface/XiH8D/src/Bridges/bridge\_optimizer.jl:1195

Note that I’m rounding the fractional solution to be integral and then generating the cut at the integral point, since I don’t have a cheap way of generating the cut at a strictly fractional point. I was wondering whether this is a known issue/something which people could maybe propose a workaround for (e.g. is there an equivalent of “fractional=false” in new JuMP?).

I think this might be a bug in either CPLEX or the bridge between JuMP and CPLEX, since the same code works correctly when using Gurobi 9.0 and JuMP.

I can also cook up a minimal working example if requested

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [March 2, 2020, 7:29pm UTC](https://discourse.julialang.org/t/jump-0-20-1-possible-bug-in-cplex-when-using-generic-lazy-callback/35425/2 "2020-03-02T19:29:50Z")

</div>

Per the docs [IBM Documentation](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackrejectcandidate.html) it looks like we can only reject candidates at `CALLBACK_CONTEXT_CANDIDATE`.

I don’t have time to investigate further. It would be great if you could investigate the fix and report if it is what we should be doing: [Update MOI\_callbacks.jl by odow · Pull Request #286 · jump-dev/CPLEX.jl · GitHub](https://github.com/JuliaOpt/CPLEX.jl/pull/286)

p.s. reproducible examples are _always_ helpful.
