model = JuMP.Model(Clarabel.Optimizer)
*set variables and contraints*
write_to_file(model, "my_model.lp")

The model is also solved correctly by Clarabel. However, problems occur when I try to read it.

model = read_from_file("my_model.lp")
set_optimizer(model, Clarabel.Optimizer)
optimize!(model)

I get the error:

LoadError: MathOptInterface.LowerBoundAlreadySet{MathOptInterface.Interval{Float64}, MathOptInterface.GreaterThan{Float64}}: Cannot add `VariableIndex`-in-`MathOptInterface.GreaterThan{Float64}` constraint for variable MathOptInterface.VariableIndex(1) as a `VariableIndex`-in-`MathOptInterface.Interval{Float64}` constraint was already set for this variable and both constraints set a lower bound.

These 3 lines are all I’m doing in the read portion. Also, it throws the same error if I get rid of the second line.

julia> using JuMP
julia> model = Model();
julia> @variable(model, 0 <= x <= 1)
x
julia> write_to_file(model, "model.lp")
julia> read_from_file("model.lp")
ERROR: MathOptInterface.LowerBoundAlreadySet{MathOptInterface.Interval{Float64}, MathOptInterface.GreaterThan{Float64}}: Cannot add `VariableIndex`-in-`MathOptInterface.GreaterThan{Float64}` constraint for variable MathOptInterface.VariableIndex(1) as a `VariableIndex`-in-`MathOptInterface.Interval{Float64}` constraint was already set for this variable and both constraints set a lower bound.
Stacktrace:

Thanks, I tried using the package manager to add the branch you linked here

add MathOptInterface#od/fix-lp-read

This worked with no issues, but then I got the same error when running my code. Not sure if I am not doing it correctly or if it just hasn’t been updated.

Edit: I think the problem is that it hasn’t been updated properly in my package directory