Issue with ECS Fargate Container Not Reflecting Latest Changes Post Recreation

0

Hello all,

I hope you're all doing well. I'm currently grappling with an unexpected issue in my AWS environment, and I'm reaching out to seek your valuable insights.

Here's the scenario: I have a CodeBuild project set up to generate Docker images, which are then pushed to an ECR registry. Following this, my ECS Fargate container is recreated, and the latest version is deployed. The puzzling part is that, despite this seemingly routine process, the changes in my application are not visible after the container recreation.

What makes this even more perplexing is that this deployment process has been working flawlessly before, and I haven't made any changes to the CodeBuild buildspec file or the deployment procedure. I'm struggling to understand why the latest application changes are not reflected in the newly created ECS Fargate container.

Has anyone else experienced a similar issue? What steps should I take to troubleshoot and identify the root cause of this discrepancy? Could there be any specific areas I should focus on or configurations I might have overlooked?

I appreciate any insights or advice you can provide to help me resolve this issue and ensure that my deployments continue to reflect the latest changes in the application.

Thank you for your time and expertise!

Best regards,

3 Answers
0

You will need to check all the following to find the root cause.

Please check the expected version/build of the container has been published to the ECR.

Make sure a new task definition version was created pointing to the expected container tag/sha256

Ensure the ECS service is using the correct task def version.

Make sure that there’s no deployment failures on the service. If there’s an issue with spinning up the new container it will keep failing and retrying while still running an old version of your application.

Check the events on the service to make sure it’s actually trying to deploy a new image.

Upon a stable state, the old versions will not be stopped.

profile picture
EXPERT
answered 5 months ago
profile pictureAWS
EXPERT
reviewed 5 months ago
  • Hello,

    Thanks for the answer.

    I already check that, everything looks fine and the latest version of the docker image has been deployed but still the changes are not visible in the app.

  • Perhaps there’s a build issue or your changes haven’t been merged into the correct branch? Not sure what else to suggest from here. Could it be an issue with your changes in your app not working as expected?

0

Hi,

did you try the CLI command aws ecs update-service to see if it helps?

It is documented at https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/update-service.html

Best,

Didier

profile pictureAWS
EXPERT
answered 5 months ago
  • Hello,

    Thanks for the answer.

    This command is the last step in my pipeline, but still the he changes are not visible in the application.

0

I experienced the same behavior. After studying the logs from my bitbucket-pipeline, I discovered that it actually built the wrong version. I see that you confirm that you have deployed the correct version, but I thought I'll leave a comment here anyway for others bumping into this. The reason seemed to be that there were some changes in the master-branch which were not merged into my feature-branch, so somehow the pipeline built latest feature-branch updated with latest changes from master-branch. After merging changes from master-branch into my branch and pushing this, the correct version was built and changes reflected in AWS.

Regards, Oddvin

profile picture
Oddvin
answered 6 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions