amplify-hosting
amplify-hosting copied to clipboard
BUG - Amplify is not serving correct build
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
df9v3hnihrz8x
Region
us-east-1
Amplify Console feature
Build settings
Describe the bug
I have multiple git branches connected to the Amplify app ('local', 'develop', 'production').
develop and production don't appear to be updating with the latest build on either the amplify URL, or the domain name I've added.
Expected behavior
When merging changes into my develop and production branches within Git, I was expecting amplify to update with the latest changes (post build).
Reproduction steps
- I created 2 amplify hosting environments in the same app, linking to 'develop' and 'production' branches in Git (with continual deployment).
- I work on a branch called 'local', then merge into 'develop' and 'production' in git, expecting a rebuild, and then see the merged changes reflected when visiting the amplify URL.
- These changes were not reflected.
- Having tried the above, to check, I created another hosting environment based on the 'local' branch (with all the updates). When the build completed, the 'local' hosting environment displayed the latest.
So it looks the build in amplify does reflect the latest if/when created for the first time ('local' branch in point 5 above), but does not reflect changes when a build is triggered from a merged branch ('develop' and 'production').
Build Settings
version: 1
backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Additional information
No response
Hi :wave:, thanks for opening! While we look into this...
If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.
Lastly, please make sure you've specified the App ID
and Region
in the issue!
Hi @alastairayliffe 👋🏽, if you are merging locally then you'll have to push the changes in your develop
or production
branch after merging from local
. Merging locally won't trigger a new build because Amplify is hosting code stored in the remote repository on GitHub. Additionally, if you open a pull request to merge from local
to another branch that is deployed in Amplify and approve the merge request in GitHub, a new build will be triggered.
Please let me know if I misunderstood your issue or if I can provide more assistance.
Hi @hloriana,
Thanks for the response and apologies for the confusion.
Just to confirm, I'm pushing my 'local' branch up to git. Within Git, I'm then merging my 'local' branch into the 'develop' and 'production' branches (in hindsight, I shouldn't call a branch 'local' as this is making it mega confusing :)...
But to clarify, I'm not merging locally (all merging is done in git).
So currently, within Git, all branches ('local', 'develop' and 'production') are the same (within git, I merged 'local' into 'develop' and then 'develop' into 'production').
Within Amplify, the develop and production hosted environments (linked to 'develop' and 'production' branches in Git) are references an older version...
It's quite odd...
The provision log within amplify does appear to be pulling correctly from Git (within git, the develop branch is 'c3d08e7', which matches the log in amplify. See below for snippet from amplify provision log)-
HEAD is now at c3d08e7 Merge pull request #15 from alastairayliffe/local
So it does appear to be pulling correctly from Git... But when I look at the end result, it doesn't appear to be updating...
I updated the name from Hey Presto to Consumabull and merged all branches in Git...
This is what it should look like if referencing the latest branch-

This is what it currently looks like (even after redeployment in my production and develop branches)-

It's a bit confusion to me... Would it help if I share all amplify logs?
Thanks,
I have a similar issue, that the new build does not reflect on the production site. One thing I notice is that the build time was normally around 15 mins, but it is now 6mins and nothing is updating. It is SSR backed by next.js and served in performance mode in amplify.
Similar issue. Using next.js. Made updates to master branch, pushed to github, amplify build is triggered and runs successfully, then go to the site and its serving the old version of master. I looked in the S3 bucket for the amplify project and it looks like no new files are added and nothing is changed from the build.
I have not changed anything about how I deploy, and even has a successful deployment yesterday with no issues. AppId: dhyps894sr29r. Region us-east-2
Similar issue. Using next.js. Made updates to master branch, pushed to github, amplify build is triggered and runs successfully, then go to the site and its serving the old version of master. I looked in the S3 bucket for the amplify project and it looks like no new files are added and nothing is changed from the build.
I have not changed anything about how I deploy, and even has a successful deployment yesterday with no issues. AppId: dhyps894sr29r. Region us-east-2
Also using Next.JS and SSR. My build time has been cut in ~half similar to mai1015. I am also experiencing this issue (seemingly no propagation of changes to Cloudfront) as my Cloudfront has a last modified date of 1 week prior to Amplify's last successful build and timestamp (1/27/2022).
Any update on this? I can no longer update several production sites.
I was having the same problem yesterday, it started working today again, didn't have to change anything on my end
Hi, I just tried again and it's still not working for me (serving old builds).
Thanks,
@Alissonsleal @charlieboles are you still facing hte issue?
@alastairayliffe any chance this is related to caching? Do you have custom headers configured where you may be setting a cache-control
header with a long max-age
value?
@swaminator I cannot tell, now instead of failing silently, existing branches experience this issue #2551 on redeploy. Here's an app id for reference: dbq6c91n3hrjc. This issue is more severe as now sites will experience downtime instead of defaulting to the last working build.
@charlieboles , agree on the severity. This issue has taken our site practically down since most of the data cannot be served to the Front End.
@alastairayliffe any chance this is related to caching? Do you have custom headers configured where you may be setting a
cache-control
header with a longmax-age
value?
I don't think so. I don't have any caching set up...
@Alissonsleal @charlieboles are you still facing hte issue?
no, it's working fine on us-east-2, it's slower than yesterday but atleast it's working now.
The 4 minute builds weren't being deployed, but the 11 minute ones are working fine
Hey, having run a few tests, it might actually be the cache :)...
If anyone else experiences a similar issue, I took the below out of my build spec and that seemed to do the trick...
cache:
paths:
- node_modules/**/*
Build spec post change looks like -
version: 1
backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
@charlieboles and @carlosbvz can you try @alastairayliffe's workaround to see if this unblocks you? We are investigating this further.
Hi @hloriana ,
Not really, I made a test this morning (enabling my NextJs lambdas again), but I got the same error:
503 ERROR
The request could not be satisfied.

Closing this issue but feel free to re-open this if you have questions.
@victorccccc this is still a problem for me. I've tried the advice in here, no matter what I do I cannot get an updated version of the frontend deployed.
@dayhaysoos Hi, can you share your appId? Thanks
@victorccccc the appId is: d3vb0tcd5f5lde
It seems that it only rebuilds the initial deploy I've done when I set this up. I followed the instructions from the docs site on the set up
any update on this issue ?
Same issue
We have since launched fully managed Next.js support and have not heard about a reoccurence of this issue. Resolving.
This issue is now closed. 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.
This issue has been automatically locked.