aws-samples / aws-refarch-wordpress

This reference architecture provides best practices and a set of YAML CloudFormation templates for deploying WordPress on AWS.
MIT No Attribution
1.08k stars 609 forks source link

AutoScaling group in web stack fails to launch, PHP55 not avialable #91

Open awsdiegorad opened 2 years ago

awsdiegorad commented 2 years ago

Currently, it does not seem to be possible to launch the "Web" stack. The Auto Scaling Group resource, with logical ID "WebAutoScalingGroup" will fail to create with an error stating that 0 Success signals were received from the generated instances

==== Received 0 SUCCESS signal(s) out of 2. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement

Taking a look at the console logs of one of the generated instances, I see that the "php55-pear" package is not available for installation, failing the run.

+ /opt/aws/bin/cfn-init --configsets deploy_webserver --verbose --stack WordPress1-web-PPL1N99D78WX --resource WebLaunchConfiguration55 --region us-east-1
Error occurred during build: Yum does not have php55-pear available for installation
Sep 26 03:15:03 cloud-init[2439]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
Sep 26 03:15:03 cloud-init[2439]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
Sep 26 03:15:03 cloud-init[2439]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/dist-packages/cloudinit/config/cc_scripts_user.pyc'>) failed

Checking the CloudFormation template, I see that there are 3 different versions available of php (php55, php56, and php70). I tried installing each of this packages on a stand alone EC 2 instance, and found that none of them are available.


[root@ip-xxx-xx-xx-xxx ec2-user]# yum install php55
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package php55 available.
Error: Nothing to do

[root@ip-xxx-xx-xx-xxx ec2-user]# yum install php56
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package php56 available.
Error: Nothing to do

[root@ip-xxx-xx-xx-xxx ec2-user]# yum install php70
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package php70 available.
Error: Nothing to do
dominic-pucci commented 2 years ago

So, there are several related problems to this. After digging into the template, it looks like someone changed the available PHP versions to:

PHPVersion:
    AllowedValues:
    - 8.1
    - 8.0
    - 7.4
    Default: 8.1
    Description: The version of PHP to install.
    Type: String 

But, they didn't change any of corresponding launch configurations. The only change that actually happened is:

 PHP55:
    !Equals [ 8.1, !Ref PHPVersion ]
  PHP56:
    !Equals [ 8.0, !Ref PHPVersion ]
  PHP70:
    !Equals [ 7.4, !Ref PHPVersion ]

This then obviously causes a parameter value of 8.1 to deploy the PHP 5.5 Launch Configuration.