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

No CloudFormation template found at /codebuild/output/ #13380

Closed
2 tasks done
leandrorp opened this issue Oct 30, 2023 · 12 comments
Closed
2 tasks done

No CloudFormation template found at /codebuild/output/ #13380

leandrorp opened this issue Oct 30, 2023 · 12 comments
Labels
pending-triage Issue is pending triage platform-push Issues related to `amplify push`

Comments

@leandrorp
Copy link

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

12.7.1

What operating system are you using?

Window

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

After adding a new lambda with REST API, it works locally, but the pipeline does not build

No CloudFormation template found at /codebuild/output/src3518215431/src/xxx-next/amplify/backend/function/stripewebhook/stripewebhook-cloudformation-template.json
2023-10-30T22:02:44.707Z [INFO]: Resolution: Ensure the file exists and is a valid CloudFormation template.

The stripewebhook-cloudformation-template.json exists

Expected behavior

Pipeline Build successfully; I tried to amplify pull or push a lot of times.

Reproduction steps

ADD new API rest in an existing project with graphql
Add new lambda with cognito ( auth permissions)

Project Identifier

Project Identifier: 1cfb423cd45ea0cbbb19bb7d0629aa77

Log output

#2023-10-30T22:02:44.706Z [WARNING]: ✖ There was an error initializing your environment.
2023-10-30T22:02:44.706Z [INFO]: 🛑 No CloudFormation template found at /codebuild/output/src3518215431/src/axxxnext/amplify/backend/function/stripewebhook/stripewebhook-cloudformation-template.json
2023-10-30T22:02:44.707Z [INFO]: Resolution: Ensure the file exists and is a valid CloudFormation template.
                                 File path should match the following pattern: '<projectRoot>/amplify/backend/<category>/<resourceName>/<resourceName>-cloudformation-template.json' where <resourceName> should match the value from <projectRoot>/amplify/team-provider-info.json.
                                 If the resource directory was manually removed, run 'amplify remove <category>' to remove the resource from the project.
                                 Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@leandrorp leandrorp added the pending-triage Issue is pending triage label Oct 30, 2023
@ykethan
Copy link
Member

ykethan commented Oct 31, 2023

Hey @leandrorp, thank you for reaching out. When running amplify status do you observe the stripewebhook function being displayed. Additionally, does the team-provider-info.json also show an reference to the function?
Do you also observe this behaviour when running a amplify push in your terminal?

@ykethan ykethan added pending-response Issue is pending response from the issue author platform-push Issues related to `amplify push` labels Oct 31, 2023
@leandrorp
Copy link
Author

Hello @ykethan! Thanks for the response.
Yes, the stripewebhook is displayed when running amplify status
About team-provider-info.json
team

When I run amplify push locally, it runs successfully. Only in the backend build display this error

 Deployment state saved successfully.

GraphQL transformer version: 2

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Oct 31, 2023
@ykethan
Copy link
Member

ykethan commented Oct 31, 2023

@leandrorp interesting. are you running an custom build scripts? Could you provide the amplify.yml script present in the AWS Amplify console under Build settings on the left panel.

Additionally, could you add the environment variable AMPLIFY_ENABLE_DEBUG_OUTPUT in the AWS Amplify console under Environment variables on the left panel and set this to true. Could you then re-run the build and provide us the output/stack trace printed.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Oct 31, 2023
@leandrorp
Copy link
Author

Sure, buddy!

Here they are:

buildSettings

Log With debug mode on :

2023-10-31T18:30:09.490Z [INFO]: 🛑 No CloudFormation template found at /codebuild/output/src3838413546/src/acervo-front-next/amplify/backend/function/stripewebhook/stripewebhook-cloudformation-template.json 2023-10-31T18:30:09.490Z [INFO]: Resolution: Ensure the file exists and is a valid CloudFormation template. File path should match the following pattern: '<projectRoot>/amplify/backend/<category>/<resourceName>/<resourceName>-cloudformation-template.json' where <resourceName> should match the value from <projectRoot>/amplify/team-provider-info.json. If the resource directory was manually removed, run 'amplify remove <category>' to remove the resource from the project. Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/ CloudFormationTemplateFault: No CloudFormation template found at /codebuild/output/src3838413546/src/acervo-front-next/amplify/backend/function/stripewebhook/stripewebhook-cloudformation-template.json at readCFNTemplate (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/cfnUtilities.js:39:15) at ensureLambdaExecutionRoleOutputs (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/provider-utils/awscloudformation/utils/ensure-lambda-arn-outputs.js:42:72) at prePushHandler (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/events/prePushHandler.js:22:76) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.handleAmplifyEvent (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/index.js:284:13) at async eventHandler (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:304:17) at async raiseEvent (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:309:13) at async raisePrePushEvent (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:220:5) at async initializeEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:135:13) at async onSuccess (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/init-steps/s9-onSuccess.js:98:5) at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/init.js:29:9) at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9) at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5) at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9) at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Oct 31, 2023
@ykethan
Copy link
Member

ykethan commented Nov 1, 2023

Hey @leandrorp, thank you for the information. On diving into logs noticed the remove function command and REST api was run and the backend-config.json does not have a reference to the function or the API.
Could try removing the reference in team-provider-info.json and push as follows

  1. run amplify pull
  2. remove the stripewebhook in the function block of team-provider-info.json
  3. remove the stripewebhook function folder.
  4. run amplify push
  5. commit to git and let Amplify hosting build the commit.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Nov 1, 2023
@leandrorp
Copy link
Author

5. to git and let Amplify hosting build the commit.

Hey @ykethan, after doing all the steps and running amplify push, I received the same error in my terminal :

🛑 No CloudFormation template found at D:\workspace\seuacervo\seuacervo-frontend-next\amplify\backend\function\stripewebhook\stripewebhook-cloudformation-template.json

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Nov 1, 2023
@ykethan
Copy link
Member

ykethan commented Nov 1, 2023

@leandrorp interesting. on the AWS S3 console, could you open the S3 bucket amplify-<appName>-<envName>-<randomHash>-deployment, download the #current-cloud-backend.zip and extract it.
In the #current-cloud-backend, under the function folder stripewebhook do you observe a stripewebhook -cloudformation-template.json file?

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Nov 1, 2023
@leandrorp
Copy link
Author

@leandrorp interesting. on the AWS S3 console, could you open the S3 bucket amplify-<appName>-<envName>-<randomHash>-deployment, download the #current-cloud-backend.zip and extract it. In the #current-cloud-backend, under the function folder stripewebhook, do you observe a stripewebhook -cloudformation-template.json file?

Yes,
file
What do you think about removing the lambda ( it will ask for removing the rest API also)
And create all the stuff again?

Or we can try other solutions?
Thanks

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Nov 1, 2023
@ykethan
Copy link
Member

ykethan commented Nov 1, 2023

@leandrorp would you be open for a quick call? I am available on discord at handle ykethan.

@ykethan
Copy link
Member

ykethan commented Nov 1, 2023

Hey @leandrorp, thank you for taking the time in hopping on a call, it was great chatting with you.
We were able to mitigate the issue by removing the REST API and Lambda function. Please do let us know if you run into the issue again.

Closing the issue.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
Copy link

github-actions bot commented Nov 1, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@leandrorp
Copy link
Author

Hey @leandrorp, thank you for taking the time in hopping on a call, it was great chatting with you. We were able to mitigate the issue by removing the REST API and Lambda function. Please do let us know if you run into the issue again.

Closing the issue.

It was great for me too! Thanks for the support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Issue is pending triage platform-push Issues related to `amplify push`
Projects
None yet
Development

No branches or pull requests

2 participants