amplify-hosting
amplify-hosting copied to clipboard
Deploying a NextJS SSR app creates new CloudFront distribution instead of using existing one (since September 9th)
Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the FAQ.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
App Id
d1y5airyx8txqb
Region
ca-central-1
Amplify Hosting feature
Not applicable
Describe the bug
Usually, when deploying a new version of Amplify website, the existing CloudFrount distribution is used and updated. This has been the behavior for the past 9 months.
But since September 9th, when I deploy a new version of my Amplify website, it creates a new CloudFront distribution every time. My production live website is not updated since the old distribution is not updated.
Why this change in behavior? Is this a bug or expected?
Furthermore, email notifications for Amplify also stopped working today... Not sure if its a new Amplify build that brought in bugs.
Thanks
Expected behavior
- Existing CloudFront distribution should be used and updated when deploying Amplify website. (Past behavior)
- Email notification should continue to work
Reproduction steps
1- Deploy a Amplify website with an existing Cloudfront distribution 2- Notice that a new Cloudfront distribution is created. 3- Redeploy a change 4- A 3rd Cloudfront distribution is created
Build Settings
N/A
Additional information
N/A
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or 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.
@StephaneBischoff What was the resolution for this one? I'm having the same issue
I am having the same issue. The app is in ca-central-1 region and each new build and deployment creates a new CloudFront distribution since the Sep 9.
@StephaneBischoff Could you please share what what the fix that helped you to resolve this?
Hi @dansokol @zhynroman
Unfortunately, I was not able to resolve this issue. In our staging environment, AWS Amplify deployed correctly and updated the correct CloudFront distribution. But, in Production this was not the case. I posted in AWS rePost, but there was no reply.
After a few days of waiting, I decided to move everything to Vercel. It took me little more than half a day to move my simple website. Furthermore, I was able to update my NextJS application to the latest version. So it was win-win.
Best of luck.
@palpatim @mauerbac @manueliglesias . This issue is urgent. Plz we are also facing the issue. At least reply on this
This is an urgent issue for my team as well. A new Cloudfront distribution AND S3 bucket is being created on each build as well as a URL Rewrite in Amplify Console. This started for us early this morning (3:26am ET).
@costerman @aungbobotun @zhynroman @dansokol can you provide us your Amplify app id?
@costerman @aungbobotun @zhynroman @dansokol can you provide us your Amplify app id?
@Jay2113 app id: d2lw9gp91e6yf1
I also opened an issue for this: https://github.com/aws-amplify/amplify-hosting/issues/2987
@Jay2113 d7rf8fcnzpljj
Also noticed lambda's also getting created with each build. Seems like Amplify is behaving like its the first time run on each build, provisioning new resources each time instead of reusing existing resources it has already provisioned.
@costerman, @dansokol - Thank you for providing the AppId's. We're looking at the issue with priority and will keep you posted with an update shortly.
@arundna @Jay2113 I think it's not related to the APP ID because I have created multiple apps with different AWS accs, it's happening all over the AWS. [APP_ID: d26o7rkrg9pon6]. Thx for the support
Facing the same issue @Jay2113, appreciate it if you could also check these apps d1gea2s40al8l0 and d25ldgknre5sp
Thanks for providing that information. This is currently our highest priority and we are actively working on root causing this issue.
@StephaneBischoff @fevega1 @dansokol @costerman Apologies for this inconvenience. New deployments of your app should no longer create new SSR resources in your account (CloudFront distribution, Lambda@Edge functions, S3 buckets). The resources created with your last deployment will be used for future builds.
If you are using custom domains, we are actively working on a solution for having your custom domains serve the latest content. We are treating this with high priority and we'll keep you posted with an update.
Thank you all for your patience.
Please perform the following steps on your Amplify app to ensure that your custom domains are serving the latest content:
- In the Amplify Console, navigate to
App settings->Domain management - Select the
Manage subdomainsbutton -> NO NEED TO MAKE ANY CHANGES to this section - Click on the
Updatebutton
Once the domain update process has completed, navigate to your custom domains in the browser and they should now serve the latest content.
@Jay2113 I confirm that this "trick" does not work for me. "Update" button stays on "loading" state also after 30 minutes. No changes in the site.
@multivoltage can you provide us your Amplify app id?
Yes. d2skhgz4a0rx0t 20 minutes ago I tried to remove and attach staging branch without results.
@multivoltage I reviewed your app configuration and can you try the following steps:
- Remove/Delete the staging-test.conio.com custom domain from your app
d2skhgz4a0rx0twhich is currently associated to your staging branch. - Wait for the domain removal process to complete in the Amplify console.
- Re-connect the staging-test.conio.com custom domain to your staging branch.
You should then be able to see the latest content being served on both the domains (.amplifyapp.com and your custom domain for staging branch).
We've been seeing this issue. Manually running the subdomain update did get the latest deployment showing so that is good. Will we need to do that each time now or should that resolve the issue going forward?
@Jay2113 will we need to manually cleanup the extra resources that have been created? Trying to avoid any unexpected charges but also don't want to manually remove any resources and then cause automated updates to fail / lock the builds forever. Thanks
I tried it. Also removed staging branch. Tomorrow I will retry
@Jay2113 We tried these 3 steps. I have to add an extra step (commit sometings on staging). Now seems to work (I probably do a check for future commit to check if bug is fixed). My deploy log is:
2022-09-23T09:46:22 [INFO]: Starting Deployment
2022-09-23T09:46:22 [INFO]: Updating Edge config
buildId 0000000002
2022-09-23T09:46:23 [INFO]: Got archive: 19412466 bytes
2022-09-23T09:46:26 [INFO]: Deployment complete
Others times this log show us all resource created for deploy
@hloriana Any ETA/updates on a permanent fix? This is plaguing each of our amplify builds. This seems to be a somewhat major issue.
Hi @croossin 👋🏽 We apologize for the inconvenience. Your builds should not be creating new CloudFront distributions. Please provide your App ID so we can investigate why this issue is occurring for your app.
Any update on this issue ? Recently I tried migrating next JS 11 to 12
from the console these were the final logs (of deploy stage) 2023-03-07T06:53:33 [INFO]: Beginning deployment for application <MY_APP_ID>, branch:release/dev, buildId 0000001388 2023-03-07T06:54:02 [INFO]: Deployment complete.
However, When I checked after clearing cache changes were not reflecting. Hence, build was not updated Unfortunately I had to revert it back :( (Next 11 web dynamic takes whopping more than 10 mins for SSR build. It went down to 4 mins when I migrated. but changes did not reflect.)
@mittatvasoft I was not able to reproduce this behavior when migrating to Next.js 12. After migration, your application should be displaying updated content. If you are running into any issues with the migration please open a new issue with bug report template so that we can provide you assistance. Thank you!
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or 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.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.