This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Monolog dependency error blocking EC2 deployment

Discuss installing Symfony 2 here

Monolog dependency error blocking EC2 deployment

by thesly » Wed Apr 02, 2014 7:04 am

Hi,
I'm getting PHP Fatal error: Class 'Monolog\Logger when executing composer install scripts on my ec2 instance.
extract for eb-tools.log:
Generating autoload files
Code: Select all
Updating the "app/config/parameters.yml" file
PHP Warning:  constant(): Couldn't find constant Monolog\Logger::DEBUG in /var/app/ondeck/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php on line 110
PHP Fatal error:  Class 'Monolog\Logger' not found in /var/app/ondeck/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/Compiler/DebugHandlerPass.php on line 54
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception.


the strange thing is I haven't seen that error on my local box, only when pushing my git package to EC2 on AWS.
upgraded composer.phar, rebuilt composer.lock without luck.
This is easily reproduced with :
Code: Select all
sudo rm -rf vendor/monolog/
sudo /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh


nothing fancy in composer.json:
"autoload": {
"psr-0": { "": "src/" }
},
"minimum-stability": "stable",
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"doctrine/data-fixtures": "1.0.*@dev",
"doctrine/doctrine-fixtures-bundle": "2.1.*@dev",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",

did anybody experience that? is there a dependency in the way with latest symfony monolog bundle? Any feedback is appreciated, that AWS deployment method has been working very well for almost a year.
Thanks
thesly
Junior Member
 
Posts: 2
Joined: Wed Apr 02, 2014 6:40 am

Re: Monolog dependency error blocking EC2 deployment

by thesly » Fri Apr 04, 2014 6:25 am

ok, I eventually figured it out. The AWS deployement scripts execute "composer.phar" instead on "php composer.phar" like I always use for my solution in local. That "composer.phar" is therefore the global executable provided with the default AWS linux instance, which was never upgraded (it was on 1.0.0.7 alpha).
A simple "sudo composer.phar selfupdate" put everything in normal mode.
thesly
Junior Member
 
Posts: 2
Joined: Wed Apr 02, 2014 6:40 am