composer: "The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly"
This worked an hour or so back, but newest version seems to be broken - it’s always saying this on a system where the user has no default HOME set, just COMPOSER_HOME.
I notice that commits in version 96ff17c520b398d2a102d082bf0d4df3bd5c18a8
which I’m using reference this error message - a regression?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 32 (10 by maintainers)
@PatrickRyan (and everyone else who’s curious), I tried removing the composer update in the eb config, and it still didn’t work. I was able to finally get it to work by changing this extension script:
To this:
However, this causes ssh / bash_profile issues now because of the “HOME” envvar, so It’d be great if this could get sorted so we can go back to using just COMPOSER_HOME. Nevertheless, things seem to be running again.
Thanks for your help everyone!
for some reason the latest version of composer was breaking my deploy on elastic beanstalk so i just dropped the following line into my deployment files. The vendor folder/authload.php was not being created.
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update 1.0.0-alpha11
Just confirming that newest version works now - thanks.
@Seldaek I think the issue that many people have faced is that in the AWS documentation it suggests adding a
composer self-update
to the deploy scripts - it’s on this page http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_symfony2.html under “To configure Composer”.I’m well aware that this isn’t official composer documentation, but due to the AWS Linux shipping an old version of composer, composer does need updating, so this command at first glance seems logical.
I’d assumed it just updated through stable versions, and wasn’t aware it pulled the newest commits.
I think Amazon may wish to rewrite that section of their docs, but right now there isn’t an easy way to always update to a tagged release, afaik - maybe self-update should just use tagged versions?
If someone can please confirm the fix using latest build that’d be great. I tried reproducing and I think it’s fine but it’s always best to get it from someone experiencing the issue for real.
As a side-note, all those complaining here about your broken builds and how desperate the situation is, I have to say I hope you learned the lesson: Do not self-update blindly if the build is mission-critical, or at least have a mechanism in place to easily rollback composer AND stop the next builds from self-updating. We offer a rollback mechanism, and we offer tagged releases that are generally pretty stable, so the waste of engineering hours is on you as far as I am concerned.
To the others that tried to find workarounds in a sane way and didn’t try to guilt the maintainers, thank you.
Hello all! My ‘dirty’ solution was based on this stackoverflow question
Basicly this issue poped up when i was trying to install anchor cms (on DigitalOcean stack LAMP), the solution is to install composer like this
composer install -d /home/someuser/myproject
Solved the issue immadiately!
Hello @mathiasgrimm that’s exactly what we do. Build the application locally and deploy this build. Deployment would last a little bit longer, but upscaling EBS instances in AWS is faster. No more dependencies on external resources during deployment or upscaling!