0

I'm learning AWS for the first time whilst developing my personal project. I've been trying to deploy my multi-container application to AWS Elastic Beanstalk for a couple days now and thankfully I've made some progress (painfully I must admit). But the roadblock I hit now is this:

ERROR: During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.

That is the error that I see in the Github Actions Workflow logs. I made sure to delete all application versions before this deploy and I also made sure that my deployment.zip file referring to the application version was deleted in the S3 bucket. Yet it still failed. Is there somewhere else that I am missing to look in?

This is my Github Actions Workflow YML:

name: Deployment From Github to AWS Elastic Beanstalk
on:
  push:
    branches:
    - master
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout latest changes in master branch
        uses: actions/checkout@master

      - name: Generate Deployment Package
        # EBS takes in a ZIP file to place inside an S3 bucket.
        # ZIP all files recursively (-r) then call the zip file 'deploy.zip'
        # Copy everything inside (*), but exclude (-x) all node_modules
        run: zip -r deploy.zip * -x "**node_modules**"

      - name: Deploy to EBS
        uses: einaregilsson/beanstalk-deploy@v21
        with:
          aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          application_name: my-site
          environment_name: my-site-env
          version_label: "my-site-deployment-1"
          region: us-east-1
          deployment_package: deploy.zip

My Instance Role for the environment has the following permissions:

  1. AWSElasticBeanstalkWebTier
  2. AWSElasticBeanstalkWorkerTier
  3. AWSElasticBeanstalkMultiContainerDocker
  4. S3Get (I had to make this custom permission for Dockerrun.aws.json v3 configuration: doc )

The Service Role that I have for the environment is the one generated by AWS EB when I created the app:

  1. AWSElasticBeanstalkEnhancedHealth
  2. AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy

At this point I'm pretty much lost on what else I could investigate. I've tried looking through logs in my environment, but there are none.

If anyone has some experience with this, I'd greatly appreciate your input.

What I've tried so far:

I've tried rebuilding my environment multiple times incase it had any lingering references to my previous deployments. I also tried rebooting the instance through ECS. However both didn't work.

I also made changes from using Dockerrun.aws.json version 2 to version 3 - I wasn't aware that v2 is deprecated. This did help me get farther in the deployment process (it would fail before but for different reasons: Instance deployment: 'Dockerrun.aws.json' in your source bundle specifies an unsupported version. Elastic Beanstalk only supports version 1 for non compose app and version 3 for compose app. The deployment failed.). The change to v3 fixed this error.

Update #1:

I found some system logs. This is the error that I see:

<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:05:31,316 [DEBUG] Enabled single threading mode.
<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:05:31,316 [DEBUG] Creating /var/lib/cfn-hup/data
<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:05:31,326 [INFO] No umask value specified in config file. Using the default one: 0o22
<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:05:31,926 [INFO] Refreshing listener credentials
<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:05:32,092 [INFO] Scheduling next credential refresh in 1799.0 seconds
<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:06:32,100 [WARNING] Timeout of 60 seconds breached
<13>Aug 22 19:06:42 [eb-cfn-init]: 2023-08-22 19:06:32,101 [ERROR] Client-side timeout
<13>Aug 22 19:06:42 [eb-cfn-init]: Traceback (most recent call last):
<13>Aug 22 19:06:42 [eb-cfn-init]:   File "/usr/lib/python3.9/site-packages/cfnbootstrap/util.py", line 193, in _retry
<13>Aug 22 19:06:42 [eb-cfn-init]:     return f(*args, **kwargs)
<13>Aug 22 19:06:42 [eb-cfn-init]:   File "/usr/lib/python3.9/site-packages/cfnbootstrap/util.py", line 266, in _timeout
<13>Aug 22 19:06:42 [eb-cfn-init]:     raise TimeoutError(
<13>Aug 22 19:06:42 [eb-cfn-init]: cfnbootstrap.util.TimeoutError
<13>Aug 22 19:06:42 [eb-cfn-init]: 
******************* End of taillog *******************

So I suppose this is timeout error. Not sure if increasing the timeout threshold for my instance would fix this - I haven't this setting anywhere yet. Going to have to start checking.

Update #2:

Increasing the timeout threshold just delayed the failure. Not sure what else to do beyond this. Any help or input would be greatly appreciated.

Update #3:

I finally managed to deploy my application successfully to my AWS EB environment. What helped was changing my instance type from t3.micro to t3.small. Thankfully another user posted what helped them:

AWS Elastic Beanstalk error: Failed to deploy application

So reason #2 was my problem. Unfortunately, I still can't see my app despite having it's zip file successfully deployed. I currently get the "This site can’t be reached" page displayed upon clicking the link. I suppose there is something wrong with my configuration still. Hopefully someone has a hunch why this is the case, but in the meantime I'll keep trying to solve it.

louisgm7
  • 3
  • 3

0 Answers0