Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would a step function cancels itself when there are no errors

Tags:

I have a step function (illustrated below) and I was working out the few remaining issues when all of a sudden I hit a rather unexpected result:

  • All tasks that have completed, completed successfully without error
  • All remaining tasks simulateously cancel themselves (also no error)

enter image description here

I'm a bit dumbfounded. Has anyone seen this? Does anyone know how I'd go about troubleshooting it?

like image 506
ken Avatar asked May 31 '18 23:05

ken


People also ask

What can trigger AWS step function?

AWS Step Functions Alternatives Schedule AWS Lambda functions: You can run simple workflows (consisting mainly of one Lambda function) by incorporating the workflow logic into a Lambda function. You can then trigger the function by using an AWS Lambda schedule event.

How long can a step function run?

Step Functions has two workflow types. Standard workflows have exactly-once workflow execution and can run for up to one year. This means that each step in a Standard workflow will execute exactly-once. Express workflows, however, have at-least-once workflow execution and can run for up to five minutes.

How does step function work?

Step Functions automatically triggers and tracks each step, and retries when there are errors, so your application executes in order and as expected. Step Functions logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly.

Why does my step function not work?

The developer’s guide to Step Functions states that any state is capable of encountering runtime errors, and these errors can happen for different reasons, including: Issues with state machine definition like no matching rule within a Choice state. Task failures will happen due to an exception within a Lambda function.

What are runtime errors in step functions?

Any state can encounter runtime errors. Errors can happen for various reasons: State machine definition issues (for example, no matching rule in a Choice state) By default, when a state reports an error, AWS Step Functions causes the execution to fail entirely.

How does step functions handle errors in the state machine?

When a state reports an error and either there is no Retry field, or if retries fail to resolve the error, Step Functions scans through the catchers in the order listed in the array. When the error name appears in the value of a catcher's ErrorEquals field, the state machine transitions to the state named in the Next field.

Why can't I reference a variable in a step function?

This may not match your case, but this happens in step functions when you have a Choice state, and the Variable you are referencing is not actually in the state input. You must specify the $.type field.


Video Answer


1 Answers

This may not match your case, but this happens in step functions when you have a Choice state, and the Variable you are referencing is not actually in the state input.

The documentation says:

Note:

You must specify the $.type field. If the state input doesn't contain the $.type field, the execution fails and an error is displayed in the execution history.

but from my experience, you get a Cancelled state.

Have a look here for more info: AWS Step Functions - Choice

like image 74
Hillel Solow Avatar answered Sep 18 '22 18:09

Hillel Solow