Elastic Beanstalk Deployments Failing - Amazon Linux 2/3.1.5

0

Hi all,

We have been experiencing constant failing deployments on Elastic Beanstalk using CodePipeline.
Elastic Beanstalk Environment:

  • Platform PHP 7.4
  • Amazon Linux 2/3.1.5

We having a Symfony application running with a few cron jobs, during every deploy with CodePipeline the deployment fails with the following error message:

2021/02/12 19:16:54.089661 Executing instruction: stop php-fpm
2021/02/12 19:16:54.089672 Running command /bin/sh -c systemctl show -p PartOf php-fpm.service
2021/02/12 19:16:54.094043 Running command /bin/sh -c systemctl stop php-fpm.service
2021/02/12 19:16:54.204134 Executing instruction: FlipApplication
2021/02/12 19:16:55.339260 An error occurred during execution of command [app-deploy] - [FlipApplication]. Stop running the command. Error: remove current dir failed: unlinkat /var/app/current: directory not empty

2021/02/12 19:16:55.339271 Executing cleanup logic
2021/02/12 19:16:55.339344 CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1613157415,"severity":"ERROR"}]}]}

After the fail, retrying the deploy through CodePipeline works as expected.
We have tried killing all cron jobs prior to deploying, different folder permission, etc but the issue still persists.

Any guidance would be appreciated.

Edited by: socialRanvir on Feb 16, 2021 2:33 AM

질문됨 3년 전5543회 조회
8개 답변
0

I ran the command eb deploy 1st time with the same error as you.
However, I tried running eb deploy again for the second time and it didn't appear.
If you know why, please share it with me.

답변함 3년 전
0

It happens to us each deploy, did it only affect you once?

답변함 3년 전
0

It's happening to our application as well and as far as we can tell it happens every time we deploy using aws elasticbeanstalk instead of the eb deploy command.

The way we have it set up is;

  • commit code to Gitlab
  • Gitlab runner starts up with aws-cli installed
  • aws s3 uploads the build to S3
  • aws elasticbeanstalk create-application-version creates a new application to deploy
  • aws elasticbeanstalk update-environment will deploy the application, which will fail with the error;
    [ERROR] An error occurred during execution of command [app-deploy] - [FlipApplication]. Stop running the command. Error: remove current dir failed: unlinkat /var/app/current: directory not empty

This error does not occur when you use eb deploy \[application].

Interested to know what's going on here.

답변함 3년 전
0

Bump, anyone else?

답변함 3년 전
0

Hi,

Any movement on this? I am experiencing the same issue, we are using: PHP 7.4 running on 64bit Amazon Linux 2/3.1.6
We are using the GitHub source integration in a CodePipeline so no manual commands being used to trigger the deploy, all whatever AWS does under the hood.

Cheers

답변함 3년 전
0

This issue for me was because I was mounting EFS to a directory in /var/app/current/. Heres a related answer on stack overflow https://stackoverflow.com/a/67494984/15900388, might be helpful to some.

Edited by: wesleyhendon on May 12, 2021 6:12 AM

답변함 3년 전
0

Same issue..

답변함 3년 전
0

Same issue here. It has been happening for months but is becoming more frequent. Seems totally random, we can have multiple successes in a row with no problem and also have single/multiple failures despite no changes other than re-attempting the deployment.

Amazin Linux 2/3.2.4
Ruby 2.7 running on 64bit
Rails 6
Using the eb deploy command

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인