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.

"Stack [...] already exists, please report this issue to amplify-cli github" error and amplify console build timeout

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • 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.

How did you install the Amplify CLI?

npm

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

14

Amplify CLI Version

10.2.2

What operating system are you using?

Amazonlinux

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

no

Amplify Categories

Not applicable

Amplify Commands

init

Describe the bug

In amplify-console, since Oct. 3, we have repeatedly been getting build timeouts and the following error:

[31mAn error occurred when creating the CloudFormation stack 2022-10-05T20:46:14.908Z [INFO]: 🛑 Stack [amplify-ess-app-abdulladev-215910] already exists 2022-10-05T20:46:14.908Z [INFO]: Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: ‘amplify diagnose --send-report’

In my local workstation I’m able to do an amplify push with no issues, although I have not tested ‘amplify init’. I created https://github.com/aws-amplify/amplify-hosting/issues/3017 since this seems to be amplify-console issue but I have no response so far.

Since the logs are telling me to send this report to you and file an issue I’m doing so here. My project identifier (when I run amplify diagnose in my local workstation) is 3def1a2bd59d61900f734d59f169a578.

Expected behavior

Backend build should complete successfully, and if there is error it should fail immediately rather than waiting 30 min and timing out.

Reproduction steps

Do any deployment in amplify console env d2d6ty1wlg8jch

GraphQL schema(s)

# Put schemas below this line


Project Identifier

3def1a2bd59d61900f734d59f169a578

Log output

# Put your logs below this line
2022-10-05T20:46:12.838Z [WARNING]: Everything up-to-date
2022-10-05T20:46:12.844Z [INFO]: # Getting Amplify CLI Cloud-Formation stack info from environment cache
2022-10-05T20:46:12.851Z [INFO]: # Start initializing Amplify environment: abdulladev
                                 # Initializing new Amplify environment: abdulladev (amplify init)
2022-10-05T20:46:14.076Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2022-10-05T20:46:14.791Z [INFO]: Amplify AppID found: d2d6ty1wlg8jch. Amplify App name is: ess-app
2022-10-05T20:46:14.904Z [INFO]: 
                                 An error occurred when creating the CloudFormation stack
2022-10-05T20:46:14.908Z [INFO]: 🛑 Stack [amplify-ess-app-abdulladev-215910] already exists
2022-10-05T20:46:14.908Z [INFO]: Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
2022-10-05T21:15:16.557Z [INFO]: ExpiredToken: The security token included in the request is expired
                                 at Request.extractError (/snapshot/repo/build/node_modules/aws-sdk/lib/protocol/query.js:50:29)
                                 at Request.callListeners (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
                                 at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
                                 at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:686:14)
                                 at Request.transition (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:22:10)
                                 at AcceptorStateMachine.runTo (/snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:14:12)
                                 at /snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:26:10
                                 at Request.<anonymous> (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:38:9)
                                 at Request.<anonymous> (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:688:12)
                                 at Request.callListeners (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
                                 at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
                                 at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:686:14)
                                 at Request.transition (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:22:10)
                                 at AcceptorStateMachine.runTo (/snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:14:12)
                                 at /snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:26:10
                                 at Request.<anonymous> (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:38:9)
                                 at Request.<anonymous> (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:688:12)
                                 at Request.callListeners (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
                                 at callNextListener (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
                                 at IncomingMessage.onEnd (/snapshot/repo/build/node_modules/aws-sdk/lib/event_listeners.js:335:13)
                                 at IncomingMessage.emit (events.js:412:35)
                                 at IncomingMessage.emit (domain.js:475:12)
                                 at endReadableNT (internal/streams/readable.js:1334:12)
                                 at processTicksAndRejections (internal/process/task_queues.js:82:21) {
                                 code: 'ExpiredToken',
                                 time: 2022-10-05T21:15:16.554Z,
                                 requestId: '6bdc832a-e716-48b2-b468-2c5e68751cb1',
                                 statusCode: 403,
                                 retryable: true
                                 }

Additional information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
josefaidtcommented, Oct 6, 2022

Hey folks using CLI v10.2.1 I cloned an existing project from git, attempted a headless init, and was able to reproduce this issue. After switching to pull, however, I was able to successfully pull the project and initialize it locally.

➜  amplify init --envName next --yes
Note: It is recommended to run this command from the root of your app directory
Using default provider  awscloudformation

Deploying resources into next environment. This will take a few minutes. ⠙
Deploying root stack 9071 [ ---------------------------------------- ] 0/4

An error occurred when creating the CloudFormation stack
🛑 Stack [amplify-9071-next-153423] already exists

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the prDeploying resources into next environment. This will take a few minutes. ⠹
Deploying root stack 9071 [ ---------------------------------------- ] 0/4
^C⏎                                                                                                         ^Aborted!


➜  amplify pull --appId dbaciat8nbvr7 --envName next --yes
Amplify AppID found: dbaciat8nbvr7. Amplify App name is: 9071
Backend environment next found in Amplify Console app: 9071
✔ Successfully pulled backend environment next from the cloud.
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
✅ 

After upgrading to v10.2.2 I was not able to initialize my project with the same headless init command.

➜  amplify version
10.2.2

➜  amplify init --envName next --yes
Note: It is recommended to run this command from the root of your app directory
Using default provider  awscloudformation

Deploying resources into next environment. This will take a few minutes. ⠙
Deploying root stack 9071 [ ---------------------------------------- ] 0/4

An error occurred when creating the CloudFormation stack
🛑 Stack [amplify-9071-next-153423] already exists

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the prDeploying resources into next environment. This will take a few minutes. ⠧
Deploying root stack 9071 [ ---------------------------------------- ] 0/4
^C⏎                                                                                                         ^Aborted!

Marking this as a bug, as a workaround please replace init with pull in your headless scripts, or downgrade to Amplify CLI version 10.0.0.

1reaction
pedrolucasDcommented, Oct 6, 2022

Hello guys. We had the same problem here at the company I work for and we managed to solve it by downgrading to version 10.0.0. Thanks for sharing the information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backend Deployments consistently failing and timing out with ...
already exists, please report this issue to amplify-cli github" error and amplify console build timeout aws-amplify/amplify-cli#11120.
Read more >
amplify build failed with AlreadyExistsException (bucket exists)
... or closed issues. I have read the guide for submitting bug reports. ... Stack [amplify-wildrydes-prod-32220] already exists at Request.
Read more >
Build error due to failed validation of a stackName variable #62
Describe the bug Today, builds started to error out with following error: 2019-08-19T09:21:01.568Z [WARNING]: - Initializing your ...
Read more >
Error/Stacktrace on amplify push - auth token timeout? #1467
This may take a few minutes...TypeError: events is not iterable at getUniqueStacksEvents (/usr/local/lib/node_modules/@aws-amplify/cli/ ...
Read more >
AlreadyExistsException: Stack [amplify-myproj-samdev ...
Describe the bug I cloned an existing project and initialized an env called prod. I tried creating a new env samdev (I removed...
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