pbaranski
pbaranski

Reputation: 25062

GitHub Actions: Deleting stack in AWS returns Waiter StackDeleteComplete failed: Max attempts exceeded

How I can extend timeout or change sam delete properties to avoid Waiter StackDeleteComplete failed: Max attempts exceeded?

Here is my script for GitHub Actions:

  - uses: actions/setup-python@v4
    with:
      python-version: "3.8"

  - uses: aws-actions/setup-sam@v2

  - name: Delete SAM stack
    run: |
      sam delete \
        --stack-name $BUCKET \
        --config-file $FILE \
        --region $AWS_REGION \
        --no-prompts \

In GitHub Actions logs I can see error after 1 minute of wait:

08:41:12    - Deleting Cloudformation stack 1234
08:42:13 Error: Failed to delete the stack: 1234, msg: ex: Waiter StackDeleteComplete failed: Max attempts exceeded
08:42:13 ##[error]Process completed with exit code 1.

Stacks are deleted correctly in AWS but it takes 3 minutes enter image description here

Docs about using SAM when deleting stack do not contain info about wait settings: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-delete.html

Upvotes: 0

Views: 435

Answers (1)

pbaranski
pbaranski

Reputation: 25062

It was an issue in SAM CLI 1.61.0
For now the fix is to use previous version of SAM CLI without this bug:

  - uses: aws-actions/setup-sam@v2
    with:
      version: "1.60.0"

Issue: https://github.com/aws/aws-sam-cli/issues/4361 Fix brings back default timeouts of 120 attempts and 30s delay.

When fix will be released the configuration can go back to standard one:

  - uses: aws-actions/setup-sam@v2

Upvotes: 0

Related Questions