Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to find a stack (v7.0.4) #587

Closed
eschwartz opened this issue Jun 28, 2023 · 6 comments · Fixed by #592 or #593
Closed

Failed to find a stack (v7.0.4) #587

eschwartz opened this issue Jun 28, 2023 · 6 comments · Fixed by #592 or #593
Labels

Comments

@eschwartz
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

Error Description

When using release v7.0.4, deployment results in an error like:

Error: Failed to find a stack my-service-stage

And a warning like:

Warning: V1 - 'instance-stage.mydomain.io' does not exist.

Downgrading to v6.4.1 fixes the issue

Command Run

serverless deploy --verbose --stage stage

Console Output

This has been cleaned up somewhat, to remove private info:

Deploying my-service to stage stage (us-east-1)

Packaging
Using Python specified in "pythonBin": python3
Packaging Python WSGI handler...
Generated requirements from /path/to/my/app/requirements/deployment.txt in /path/to/my/app/.serverless/requirements.txt
Using static cache of requirements found at /Users/me/Library/Caches/serverless-python-requirements/843c0abdd474f831940064857629a06e5f5e461d3b8e4f8ad0cbff00790599f7_x86_64_slspyc
Excluding development dependencies for service package
Injecting required Python packages to package
Warning: V1 - 'instance-stage.mydomain.io' does not exist.
Warning: V1 - 'instance-stage.mydomain.io' does not exist.
Retrieving CloudFormation stack
Uploading
Uploading CloudFormation file to S3
Uploading State file to S3
Uploading service my-service.zip file to S3 (22.08 MB)
Updating CloudFormation stack
Creating new change set
Waiting for new change set to be created
Change Set did not reach desired state, retrying
Change Set did not reach desired state, retrying
Executing created change set
  UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - my-service-stage
  ....
  UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - my-service-stage
  ....
  UPDATE_COMPLETE - AWS::CloudFormation::Stack - my-service-stage
Retrieving CloudFormation stack


Warning: V1 - 'instance-stage.mydomain.io' does not exist.

✖ Stack my-service-stage failed to deploy (89s)
Environment: darwin, node 16.17.1, framework 3.33.0 (local), plugin 6.2.3, SDK 4.3.2
Credentials: Local, "mfa" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: Failed to find a stack my-service-stage

    at CloudFormationWrapper.<anonymous> (/path/to/my/app/node_modules/serverless-domain-manager/dist/src/aws/cloud-formation-wrapper.js:100:23)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/my/app/node_modules/serverless-domain-manager/dist/src/aws/cloud-formation-wrapper.js:8:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

2 deprecations found: run 'serverless doctor' for more details

Domain Manager Configuration
Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.

custom:
  customDomain:
    domainName: "instance-${self:provider.stage}.mydomain.io"
    basePath: ""
    stage: ${self:provider.stage}
    createRoute53Record: true

Versions

  • Domain Manager version(s): v7.0.4 (bug does not appear in v6.4.1)
  • Node/npm version: Node v16.17.1, npm v8.15.0
  • Serverless Version: v3.33.0
  • Lambda Code: Python

Possible Solution

Downgrading serverless-domain-manager to v6.4.1

npm install [email protected]

Additional context/Screenshots

Seems to be similar to #551, and a number of other related issues

I have verified that all the resources it is looking for in AWS do in fact exist and are named appropriately, including:

  • Lambda application
  • CloudFormation stack
  • API Gateway
  • Route53 domain, pointing at the CloudFront distro associated with API Gateway
  • ACM certificate (verified + active), associated with the API gateway's CF distro
@eschwartz eschwartz added the bug label Jun 28, 2023
@Verde1705
Copy link

Verde1705 commented Jul 7, 2023

Same problem, preliminary solution, give all cloudformation read permissions to the role that performs the deployment, even looking for the correct permission.

Edit:

works for me with cloudformation:DescribeStackResource permission

@zavale
Copy link

zavale commented Jul 15, 2023

@Verde1705 Could you please elaborate, what you mean by this?
I added AWSCloudFormationFullAccess policy to user on behalf of which CF performs the deployment and it didn't help to resolve the issue

@timborden
Copy link

Some context on the error (from my end).

I changed my endpoints from http to httpApi....the subdomain in Route 53 was still assigned to the old API Gateway instance, so I manually changed it to the new API Gateway instance.

I'm now getting the following error:

✖ Stack domain-production failed to deploy (151s)
Environment: darwin, node 16.15.0, framework 3.33.0 (local), plugin 6.2.3, SDK 4.3.2
Credentials: Local, "default" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: Failed to find a stack domain-production

    at CloudFormationWrapper.<anonymous> (/Users/timborden/Code/domain/backend/node_modules/serverless-domain-manager/dist/src/aws/cloud-formation-wrapper.js:100:23)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/timborden/Code/domain/backend/node_modules/serverless-domain-manager/dist/src/aws/cloud-formation-wrapper.js:8:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
V2 - Updated API mapping to '(none)' for 'ws.domain.com'

@cmcnicholas
Copy link

Same issue here. I have dev environment that I have just integrated this plugin into. I've made sure the policy has access to route53 etc. but I get Failed to find a stack review-dev as an example.

I have since, sls remove the dev services I have and redeployed with the same issue.

Before removing I can confirm the stack review-dev was available and accessible by the policy.

I might try the downgrade as people are suggestion but a major version downgrade seems like I'm going to introduce pain at the point 7 is stable.

@sromic
Copy link
Contributor

sromic commented Aug 10, 2023

@eschwartz , @rddimon II was able to debug this and found the culprit.
More less fixed the issue, need to add some unit tests to cover this cases so I would create a PR with that fix in the coming few days.

@sromic
Copy link
Contributor

sromic commented Aug 14, 2023

@eschwartz @rddimon I've opened a PR with a fix for this problem, but also extended it for all other AWS services this lib is using which could have the same problem when getting data which is paginated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment