0

I have a new beanstalk that is a migration of an old one running an app under php5.6 platform on Amazon AMI Linux. The new beanstalk is running php7.3 on Amazon Linux2. I have worked through all the migration issues and the app is running correctly on my new beanstalk. I have a load-balancer (classic) and I run autoscaling with the max and min instance settings both set to 1.

The problem occurs when I terminate the ec2. The autoscaling is creating a new ec2 but it is't deploying the application to it.

Does anyone know why this might be, or where I can look to try and debug the issue?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Nick Weavers
  • 534
  • 7
  • 23
  • Have you check any EB logs? If its not deploy last application version, then what does it do? – Marcin Oct 12 '20 at 12:34
  • 2020-10-12 14:03:35,762 P3555 [INFO] Command 01-setup-cwlogs-agent 2020-10-12 14:03:35,815 P3555 [INFO] -----------------------Command Output----------------------- 2020-10-12 14:03:35,815 P3555 [INFO] ERROR: Failed to determine linux distribution. Exiting. – Nick Weavers Oct 12 '20 at 14:08
  • That command does this: ```commands: 01-setup-cwlogs-agent: ## Install the cwlogs agent - this will also install the cli it needs (in a virtualenv) command: | setsid /tmp/cwlogs/awslogs-agent-setup.py -n -r `{"Ref" : "AWS::Region" }` -c /tmp/cwlogs/cwlogs-config.conf && exit 0; ``` – Nick Weavers Oct 12 '20 at 14:24

1 Answers1

0

What worked for me was to remove the old .ebextension config files related to cwlogs, and add the line

awslogs: []

to my config that does

packages:
  yum:

then create a new conf file as follows

files:
  "/tmp/start_aws_cloudwatch_service.sh":
    content: |
      #!/bin/sh
      systemctl start awslogsd
      systemctl status awslogsd
      systemctl enable awslogsd.service
      exit $?
    mode  : "000755"
    owner : root
    group : root
commands:    
  start_aws_cloudwatch_service:
    cwd: /tmp
    command: bash /tmp/start_aws_cloudwatch_service.sh   

After this I could see that the service was up and running

$ systemctl status awslogsd
● awslogsd.service - awslogs daemon
   Loaded: loaded (/usr/lib/systemd/system/awslogsd.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2020-10-14 14:08:19 UTC; 34min ago
 Main PID: 4029 (aws)
   CGroup: /system.slice/awslogsd.service
           └─4029 /usr/bin/python2 -s /usr/bin/aws logs push --config-file /etc/awslogs/awslogs.conf --additional-configs-dir /etc/awslogs/c...

Oct 14 14:08:19 ip-xxx-xxx-30-7.eu-west-1.compute.internal systemd[1]: Started awslogs daemon.
Oct 14 14:08:19 ip-xxx-xxx-30-7.eu-west-1.compute.internal systemd[1]: Starting awslogs daemon...

See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html

TylerH
  • 20,799
  • 66
  • 75
  • 101
Nick Weavers
  • 534
  • 7
  • 23