Describe the bug
Duplicated App in Amplify Console after upgrading Amplify-CLI to 4.x (4.2 as of now).

To Reproduce
Steps to reproduce the behavior:
Expected behavior
Single App
Additional context
Add any other context about the problem here.
Sample code
Include additional sample code or a sample repository to help us reproduce the issue. (Be sure to remove any sensitive data)
I just discovered why it ended up creating a duplicate one.
After upgrading to Amplify-CLI and running amplify push it created an Amplify App ID which is different from the Amplify App ID it got auto-generated for my existing App.
My existing App sees the front-end but back-end. My new App sees back-end but front-end.
@heitorlessa for apps that are using both console and CLI, you need to upgrade through the console by clicking redeploy this version. This will give you a backed env in the tab. After doing so, run the amplify pull command from your local terminal to get the correct appid.
@heitorlessa for apps that are using both console and CLI, you need to upgrade through the console by clicking redeploy this version. This will give you a backed env in the tab. After doing so, run the amplify pull command from your local terminal to get the correct appid.
I've tried both redeploying and pushing a new commit - No effect. Either way, I've tried amplify pull with the AppId from Amplify Console, all green but no changes in the Console itself.
I'm having the same issue.
I have various environments:
staging and prod, which are configured in Amplify Console in an app created a while agochristophe, a dev env which isn't configured in Amplify Console and that I only deploy via the CLII recently upgraded to 4.2 and when I push from christophe, it creates a new Amplify app in the console. I tried to redeploy the staging env from the Console, but it doesn't make the backend section appear anywhere.
What am I supposed to do?
@ChristopheBougere can you share your appid? Also your build settings would be helpful
@swaminator thanks for taking a look.
The original amplify app id is d2kr6iz2hgzrdy (eu-west-1). A new app has been generated with this id: d3p8otsv7y21zu.
Here is my amplify.yml:
version: 0.1
backend:
phases:
preBuild:
commands:
- (cd commons && npm ci)
- (cd cli && npm link)
- cd web
build:
commands:
- amplifyPush --simple
- (cd ../services/cleanup && npx serverless deploy --stage $USER_BRANCH --region $AWS_REGION)
- (cd ../services/images && npx serverless deploy --stage $USER_BRANCH --region $AWS_REGION)
- (cd ../services/uploader && npx serverless deploy --stage $USER_BRANCH --region $AWS_REGION)
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
postBuild:
commands:
- claptime setup-env --yes
artifacts:
baseDirectory: web/build
files:
- '**/*'
cache:
paths:
- web/node_modules/**/*
@ChristopheBougere can you turn on live updates for the Amplify CLI to latest in the Console (or pin it to version 4.2 if that's what you're using locally): https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html#setup-live-updates
Your staging env should show up. For the env named christophe we are aware of this bug in the CLI and working on it.
I can confirm it works well for my staging env. Waiting for the CLI fix.
Thanks for your help
I hit something similar while upgrading from 3.16 to 4.6.0. I even read this bug report before starting and tried my best to avoid it this from happening.
This is what I did:
AmplifyAppId addedAmplifyAppId the Console was giving me for my existing app (not the duplicate)So now I believe I should be able to push from the CLI without issues and everything seems to be working for now, but my semi loaded duplicate app in the Console persists.
Is it safe to delete that app in the Console without also deleting any Amplify resources?
You guys really need to start documenting upgrades and code your upgrades to handle stuff like this nicer in order to prevent having to experiment with solutions on a PRODUCTION system. I have yet to do a single Amplify CLI upgrade without regressions or nit picks. This time it seems like a nit pick at best, so I guess that's progress?
@kaustavghosh06 @UnleashedMind
I'd like clarification on two very basic questions (this does not seem to be documented):
1) Can an Amplify Console app be safely deleted in the UI without any Amplify resources being torn down (a new app with only backend attached was automatically created in the update process, and I'd like to get rid of it)?
2) Is the recently introduced AmplifyAppId consistent between environments or will there be a unique ID per environment (in the same project of course)?
I'm halfway in the process of upgrading from 3.x to latest release in my dev environment, but I don't want to continue to production until I have this cleared out.
Fix for this has been merged and released with v4.7.
We just recently updated from amplify cli 3.14.0 to 4.12.0 and seem to be experiencing this exact issue after the upgrade.
And AWS devs do not care to respond to my basic questions whether it's 100% safe to remove the extra app created. I would not like to remove it and have resources automatically removed effectively breaking our prod environment.
@kaustavghosh06 @UnleashedMind would you please respond at least to point 1 here: https://github.com/aws-amplify/amplify-cli/issues/2972#issuecomment-566817944.
@amcbb
If you want to add your env to an existing Amplify Console project, you should run the migration workflow on a fully setup project (by previous version of the Amplify CLI):
amplify init --appId <amplify-console-project-appId>
@houmark Sorry for the late response. Please find responses in-line for your questions
Yes, deleting the Amplify Console app in the UI won't delete your resources
The AmplifyAppID is based on your account/region If you're pushing to the same AWS account and region - your AmplifyAppID would be the same. If you have your environments in different regions/accounts, you'll have a different AmplifyAppID.
@amcbb
If you want to add your env to an existing Amplify Console project, you should run the migration workflow on a fully setup project (by previous version of the Amplify CLI):
amplify init --appId <amplify-console-project-appId>
Thanks @UnleashedMind. We were previously using amplify v 3.14.0 before the upgrade, and I missed the below text. Is it possible to configure something so no Amplify Console project is created each time a new environment is init'd (and not added to an existing project through --appId) like before? If not, this seems like a strange design change to me since team-workflow often has many backend development environments for developers that have no need to be added to Amplify Console projects (whether new or existing apps).
