question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Step Functions: "State cannot be reached error" when it can be

See original GitHub issue

Describe the bug

I have a Step Function defined in ASL that includes a state used as a catcher for a different Map type state. When this state machine/SAM template is deployed, that state does not raise any errors, and correctly appears in the diagram as one of the output paths of the Map state.

Screen Shot 2020-05-28 at 6 52 18 AM

If I pull this ASL definition into it’s own file to get checked my AWS Toolkit, the Tasks Map Catcher state triggers an error:

The state cannot be reached. It must be referenced by at least one other state.

{
	"resource": "/Users/farski/Repositories/Porter/state-machine.asl.json",
	"owner": "_generated_diagnostic_collection_name_#5",
	"severity": 8,
	"message": "The state cannot be reached. It must be referenced by at least one other state.",
	"startLineNumber": 694,
	"startColumn": 5,
	"endLineNumber": 694,
	"endColumn": 24
}

There seems to be a discrepancy between the way AWS Toolkit is checking for state reachability and the way Step Functions itself is resolving possible transitions.

To Reproduce

Save the ASL from this template to its own file and have it checked by AWS Toolkit. Compare the result with a deploy of that template.

Expected behavior

No error.

Desktop:

  • OS: macOS 10.15.4
  • Visual Studio Code Version: 1.45.1
  • AWS Toolkit Version: 1.10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
alanbocommented, May 29, 2020

I confirm the issue. This is a problem within amazon-states-language-service. Map state does not validate the “Next” property within “Catch” block of “Map” state. Catch block within “Task” and “Parallel” state do work as expected. https://github.com/aws/amazon-states-language-service/issues/25

1reaction
alanbocommented, Jun 29, 2020

@alanbo How long does it take for work in ASLS to get into the VSC toolkit?

I will update the AWS Toolkit to the new version of ASLS and it will be available with the next release. Usually, merged/released updates to the ASLS npm package will be available with the next release of the AWS Toolkit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling in Step Functions - AWS Documentation
Any state can encounter runtime errors. Errors can happen for various reasons, such as the following examples: ... By default, when a state...
Read more >
AWS Step Functions Error Handling - Dashbird
In this article, you'll learn the common reasons behind AWS Step Functions errors and how to assess and handle them.
Read more >
Find Answers to AWS Questions about AWS Step Functions
If step function fails, error can be thrown out of lambda, which keeps the message in SQS and will be retried by poller,...
Read more >
how to access error information in Step Function from previous ...
Cause cannot be dynamic. The input that is passed to Fail state is ignored and fix strings are used for error and cause....
Read more >
Handling Error Conditions Using a Step Functions State ...
Unhandled errors in Lambda are reported as Lambda.Unknown in the error output. These include out-of-memory errors and function timeouts. You can match on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found