# Troubleshooting

This page contains the most common errors that could happen when using CoraPlex and how to resolve them.

## Stop Iteration

Stop iterations usually happen when you try to resolve a designator for which there is no solution or if you iterate over a
designator and reached the end of all possible solutions.

When you try to resolve a designator which has no solution the error will look something like this.

```{code-block} python
:emphasize-lines: 7

    753 def ground(self) -> Union[Object, bool]:
    754     """
    755     Return the first object from the bullet world that fits the description.
    756
    757     :return: A resolved object designator
    758     """
--> 759     return next(iter(self))

StopIteration:
```

If you encounter such an error the most likely reason is that you put the wrong arguments into your DesignatorDescription.
The best solution is to double check the input arguments of the DesignatorDescription.

## Error when performing Actions or Motions

If you get an error when trying to perform an action or motion designator that complains about a missing execution
environment, then you did not specify how the designator should be executed. You can specify how the designator should
be performed by wrapping the call in the `simulated_robot` or `real_robot` environment. This is also explained in
the [Action Designator Example](https://cram2.github.io/cognitive_robot_abstract_machine/coraplex/notebooks/action_designator.html#Navigate-Action).

```python
from coraplex.execution_environment import simulated_robot
from coraplex.plans.factories import execute_single
from coraplex.robot_plans.actions.core.navigation import NavigateAction

with simulated_robot:
   execute_single(NavigateAction(target_location=pose), context=context).perform()
```
