# ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model

**URL:** https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586
**Category:** Optimization (Mathematical)
**Tags:** question, highs
**Created:** [September 19, 2024, 6:37am UTC](https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586 "2024-09-19T06:37:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [September 19, 2024, 6:37am UTC](https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586/1 "2024-09-19T06:37:39Z")

</div>

```julia
ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model.

```

I got this error when solving an MILP model using `HiGHS`. Do anyone know what it means? Thank you!

---

<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: [September 19, 2024, 7:32am UTC](https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586/2 "2024-09-19T07:32:33Z")

</div>

It means you did not check `is_solved_and_feasible(model)` to see if HiGHS found a feasible solution to your model.

See [Solutions · JuMP](https://jump.dev/JuMP.jl/stable/manual/solutions)

You must _always_ check the status of a solver before querying a solution.

---

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [September 19, 2024, 9:03am UTC](https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586/3 "2024-09-19T09:03:46Z")

</div>

Thank you @odow . The fact is the model is infeasible. I’ll look for the reason.
