Skip to content

Bug Report: Amplify Build Failure - StackDoesNotExistError & Modifying service token is not allowed #2826

Open
@vishaljkk

Description

@vishaljkk

Environment information

41 npm audit fix --force
42 Run `npm audit` for details.

43 2025-05-22T06:03:05.517Z [INFO]: # Executing command:
npx ampx generate outputs --branch $AWS_BRANCH --app-id $AWS_APP_ID

44 2025-05-22T06:03:08.610Z [INFO]: Both the legacy 'AWS_DEFAULT_REGION' and preferred 'AWS_REGION' environment variables detected. Using 'AWS_REGION'

47 2025-05-22T06:03:08.716Z [WARNING]: ampx generate outputs
48 Generates Amplify backend outputs

69 2025-05-22T06:03:08.717Z [INFO]: StackDoesNotExistError: Stack does not exist.
70 Resolution: Ensure the CloudFormation stack ID or Amplify App ID and branch specified are correct and exists, then re-run this command.
71 Cause: Stack with id amplify-d2****ut991-dev-branch-ae****8c3aa does not exist

72 2025-05-22T06:03:08.800Z [ERROR]: !!! Build failed
74 2025-05-22T06:03:08.801Z [ERROR]: !!! Error: Command failed with exit code 1


📍 Environment
Region: ap-south-1

Amplify CLI: v?

Node.js: v?

Framework: SSR (e.g., Next.js? confirm if relevant)

Stack ID: amplify-d24o***991-dev-branch-ae***aa




Expected Behavior
Amplify deployment should:

Successfully update backend stacks.

Generate outputs without failing on missing stack or service token mutation.

Describe the bug

Cause: The stack named amplify-d24oll**91-dev-branch-aeaa failed to deploy:
UPDATE_ROLLBACK_COMPLETE: Modifying service token is not allowed.

Embedded stack arn:aws:cloudformation:ap-south-1:571600869009:stack/amplify-d991-dev-branch-aed41-cloudWatchRumA2869-1IK6****5D8/... was not successfully updated.

Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason:
The following resource(s) failed to update: [cloudWatchRumCustomResource3F***439].###

Reproduction steps

Steps to Reproduce
Deploy Amplify project via CI/CD pipeline.

Use npx ampx generate outputs with $AWS_BRANCH and $AWS_APP_ID.

Stack update fails due to a custom resource error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-community-responseIssue is pending a response from the author or communitypending-triageIncoming issues that need categorizationquestionQuestion or confusion about some aspect of the product

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions