I get the error below when I try to solve a model in JuMP using SCIP. There is no error if I instead use HiGHS.
$ julia Oscar.jl
ERROR: LoadError: MathOptInterface.DeleteNotAllowed{MathOptInterface.VariableIndex}: Deleting the index MathOptInterface.VariableIndex(368) cannot be performed: Can not delete variable while model contains constraints! You may want to use a `CachingOptimizer` in `AUTOMATIC` mode or you may need to call `reset_optimizer` before doing this operation if the `CachingOptimizer` is in `MANUAL` mode.
Stacktrace:
[1] delete(o::SCIP.Optimizer, vi::MathOptInterface.VariableIndex)
@ SCIP ~/.julia/packages/SCIP/BUSgq/src/MOI_wrapper/variable.jl:45
[2] delete(b::MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer}, vi::MathOptInterface.VariableIndex)
@ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/bridge_optimizer.jl:601
[3] delete(model::MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer}, bridge::MathOptInterface.Bridges.Constraint.CountBelongsToMILPBridge{Float64, MathOptInterface.VectorOfVariables})
@ MathOptInterface.Bridges.Constraint ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/Constraint/bridges/count_belongs.jl:139
[4] final_touch(bridge::MathOptInterface.Bridges.Constraint.CountBelongsToMILPBridge{Float64, MathOptInterface.VectorOfVariables}, model::MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer})
@ MathOptInterface.Bridges.Constraint ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/Constraint/bridges/count_belongs.jl:280
[5] _final_touch(bridges::OrderedCollections.OrderedSet{MathOptInterface.Bridges.Constraint.CountBelongsToMILPBridge{Float64, MathOptInterface.VectorOfVariables}}, model::MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer})
@ MathOptInterface.Bridges.Constraint ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/Constraint/map.jl:324
[6] final_touch(map::MathOptInterface.Bridges.Constraint.Map, model::MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer})
@ MathOptInterface.Bridges.Constraint ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/Constraint/map.jl:331
[7] final_touch
@ ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/bridge_optimizer.jl:459 [inlined]
[8] optimize!
@ ~/.julia/packages/MathOptInterface/57fsF/src/Bridges/bridge_optimizer.jl:375 [inlined]
[9] optimize!
@ ~/.julia/packages/MathOptInterface/57fsF/src/MathOptInterface.jl:83 [inlined]
[10] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{SCIP.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/57fsF/src/Utilities/cachingoptimizer.jl:316
[11] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ JuMP ~/.julia/packages/JuMP/vuP7I/src/optimizer_interface.jl:185
[12] optimize!
@ ~/.julia/packages/JuMP/vuP7I/src/optimizer_interface.jl:163 [inlined]
[13] top-level scope
@ ./timing.jl:220