Error reference

Cannot approve a wave plan in this status

1 min read

The execution controller checks a plan's status before every transition. Approve requires draft; pause and resume have their own preconditions and throw the same shape of error naming the status that blocked them.

Why the status is in the message

Cannot approve wave plan in status: approved and ...: executing are very different situations. The first is a duplicate click or a retried request and is harmless. The second means something tried to approve a plan already running, which is a real ordering bug.

An error saying only "cannot approve" collapses those into one ticket. Naming the state turns it into a diagnosis.

The three transitions

Approve moves draft → approved. Pause and resume move between running and paused. Each reads the current row and refuses if the plan is not in a state the transition is defined from.

What causes it in practice

A retried request. The first approve succeeded and the client did not see the response, so it tried again. The plan is now approved and the second call correctly refuses.

Two people acting on the same plan. Both see a draft, both approve; one wins.

Resuming something that was never paused. Usually a UI that offers the control regardless of state.

How to fix it

Read the current status before deciding what to do. The message tells you what it is, and the transition you want is probably already done — a plan in approved after a failed-looking approve is a success, not a failure to retry.

For the ordering bug, the fix is upstream: whatever dispatched before approving needs to wait on the approval rather than assume it.