jeudi 28 mai 2015

AWS elastic beanstalk git deployment suddenly failing due to composer issue despite no changes to composer.json

I have a number of environments running in AWS Elastic Beanstalk. I deploy direct from git using git aws.push.

I use composer.json to install required php sdk's. I've not changed this file for a long time but it's suddenly started failing in all environments.

Output from the AWS logs is

+ echo 'Found composer.json file. Attempting to install vendors.'
Found composer.json file. Attempting to install vendors.
+ composer.phar install --no-ansi --no-interaction
Loading composer repositories with package information
Installing dependencies



  [RuntimeException]                                                                                                                                                 
  Could not load package aws/aws-sdk-php in http://packagist.org:     [UnexpectedValueException] Could not parse version constraint ^5.3:     Invalid version string "^5.3"  






  [UnexpectedValueException]                                              
  Could not parse version constraint ^5.3: Invalid version string "^5.3"  



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]



2015-05-28 09:57:18,414 [ERROR] (15056 MainThread)     [directoryHooksExecutor.py-33] [root directoryHooksExecutor error] Script     /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed     with returncode 1

my composer.json is:

{
"require": {
    "aws/aws-sdk-php": "2.7.*",
    "monolog/monolog": "1.0.*",
    "facebook/php-sdk-v4" : "4.0.*",
    "ext-curl": "*",
    "paypal/sdk-core-php": "v1.4.2",
    "paypal/permissions-sdk-php":"v2.5.106",
    "paypal/adaptivepayments-sdk-php":"2.*"
}
}

I notice it does want the aws-sdk-php but the version is not 5.3 (which is mentioned in the logs).

5.3 makes me think php version, checking php -v i get

php -v
PHP 5.5.12 (cli) (built: May 20 2014 22:27:36)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend     Technologies

I've tried re-installing older versions that have previously installed fine and they also fail with the same error. This has to be due to the environment. Does anyone know if there have been changes recently.




Aucun commentaire:

Enregistrer un commentaire