Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview
On this page

Cancelled

The durable run your call waited on was cancelled before it finished.

Cancelled means the durable run behind your call stopped because someone cancelled it. The status is 409.

Issue

A call to a durable handler fails with this body.

{"error": {"code": "Cancelled", "message": "the run was cancelled"}}

In a luna, ctx.call throws a LunaCallError whose kind is "Cancelled". A run started with ctx.send has no caller to tell, so its RunInfo shows status: "cancelled" instead.

Cause

Code somewhere called cancel(runId) on the luna’s runs, through ctx.runs(luna, key). The run stops at its next durable operation, such as a step, a sleep or a wait. Its compensations run first, newest step first, and then the run ends as cancelled.

Cancelled differs from Internal. An Internal run failed on its own. A Cancelled run was stopped on purpose, and its compensations have undone what they cover.

Solution

Do not retry the call to resume the run. A new call starts a new run from the beginning.

  • Check who cancels runs of this type, and whether this run should have been one of them.
  • Read the run with ctx.runs(luna, key).get(runId) to see where it stopped.
  • If the work is still wanted, start it again with a new call.

Undo steps when a run fails explains what a cancel undoes.

Was this page helpful?