Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find Composer. #303

Closed
sobit opened this issue Mar 18, 2014 · 9 comments
Closed

Could not find Composer. #303

sobit opened this issue Mar 18, 2014 · 9 comments

Comments

@sobit
Copy link

sobit commented Mar 18, 2014

I have composer installed globally on my system. It is accessible from apache user as well, i.e. when I run which composer I get /usr/local/bin/composer.

However, running the build fails with the error Could not find Composer.. Any ideas?

@sobit
Copy link
Author

sobit commented Mar 18, 2014

After running the build from the console, found interesting piece:

[2014-03-18 22:50:14] RunCommand.INFO:  {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO:   - Installing symfony/icu (v1.2.0) {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO:     Downloading: 100% {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO: Failed to download symfony/icu from dist: /home/ubuntu/.composer/cache/files/symfony/icu does not exist and could not be created. {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO: Now trying to download from source {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO:   - Installing symfony/icu (v1.2.0) {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO:     Cloning 7299cd3d8d6602103d1ebff5d0a9917b7bc6de72 {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO:  {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.INFO:   - Installing psr/log (1.0.0) {"buildID":"15"} []
[2014-03-18 22:50:14] RunCommand.ERROR: PLUGIN STATUS: FAILED {"buildID":"15"} []

Should we add a feature request to better error handling in the web interface?

@meadsteve
Copy link
Contributor

I thought the web interface would show everything logged at LogLevel::INFO. So I'm surprised this isn't there. So there's two separate issues here:

  1. It shouldn't report "Could not find Composer" as that's not true.
  2. You should be able to see the log above without running the console.

Can you confirm that you can't see any of the log information in the web interface? If you can't I'll create a separate issue for this.

@sobit
Copy link
Author

sobit commented Mar 20, 2014

I spent several hours and finally found a solution (which I don't like to be honest, but at least it works).

Web log didn't show me anything useful to understand the problem.

Later on, I found out that I have installed composer using root and composer cache wasn't reachable by www-data user.

Then I reinstalled composer using www-data user. Everything was fine when I was running the command phpci:run-builds from the console manually under the www-data user. But when this command was running by crontab, it was always failing. Tried both putting cronjob to root's crontab with specifying the user and to www-data's crontab. Nothing worked.

I ended up with a workaround by downloading composer.phar and putting it to the PHPCI root. As I understood from the PHPCI sources, it checks for this path as well.

It worked. But I don't like the way I made it working. Could be my lack knowledge of Linux or something I just misunderstood. Would really appreciate for any help.

@meadsteve if you need web logs I was getting, I can post them here.

@mikebronner
Copy link
Contributor

I have the same issue. Thanks for posting the work-around.

@dancryer
Copy link
Owner

I assume this has been resolved by now, so I'm going to close this off. Please feel free to reopen if that isn't the case. :)

@oRastor
Copy link

oRastor commented Jul 11, 2014

Just add to your crontab PATH /usr/local/bin.

@Stefaminator
Copy link

Sorry guys but i think this issue has not been resolved!
I don't know how to reopen it.

Same configuration for me: installed composer in /usr/local/bin and i got the error "composer can not be found"

@oRastor adding the following line in crontab results in many more not-found-errors than before:
PATH=/usr/local/bin

@mgdigital
Copy link

I've arrived on this page after experiencing the same problem, but have found a better workaround. Assuming composer is already installed globally to /usr/local/bin/composer, you can just make a symbolic link to /usr/bin/composer allowing it to be found by the cron job:

ln -s /usr/local/bin/composer /usr/bin/composer

@mertoksuz
Copy link

@oRastor

Thank you, solved my problem.

I used like this;

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants