rocketeer icon indicating copy to clipboard operation
rocketeer copied to clipboard

Rocketeer can't find composer

Open tkuijer opened this issue 9 years ago • 13 comments

Rocketeer fails with

|===> Checking presence of required drivers
The Composer package manager could not be found
The tasks queue was canceled by task "Setup"

The composer command exists on the server, and can be found from a regular SSH connection.

Version:

$ rocketeer --version
Rocketeer version 2.0.6

Error occurs with a globally installed Rocketeer, when I install rocketeer in my project using composer, it works.

tkuijer avatar Feb 24 '15 08:02 tkuijer

Error occurs with a globally installed Rocketeer, when I install rocketeer in my project using composer, it works.

Well that's... more peculiar. Both are the same version?

Anahkiasen avatar Feb 24 '15 09:02 Anahkiasen

Yes, both are Rocketeer version 2.0.6

tkuijer avatar Feb 24 '15 09:02 tkuijer

Related to #410

It seems that the check is looking for a composer.json in the /current folder on the remote server. This check also occurs before "setup" so to speak, so setup fails as well.

When I create that directory and an empty composer.json the rocketeer check (and rocketeer setup) do not fail out.

$ rocketeer check -vvv
| Check (Check if the server is ready to receive the application) [~5.63s]
|-- Check/Php (Checks if the server is ready to receive a PHP application)
|=> Checking presence of git
$ git --version
[[email protected]] (production) git version 1.8.4
|=> Checking presence of Composer
$ [ -e "/var/www/test/repo/current/composer.json" ] && echo "true"
|=> Checking PHP version
|=> Checking presence of required extensions
$ /usr/bin/php -r="print defined('HHVM_VERSION') ? HHVM_VERSION : PHP_VERSION;"
$ /usr/bin/php -m
[[email protected]] (production) [PHP Modules]
apc
apcu
[[email protected]] (production) bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
json
libxml
mbstring
mcrypt
memcache
memcached
mhash
mongo
msgpack
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
SQLite
sqlite3
standard
[[email protected]] (production) sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
|=> Checking presence of required drivers
|=> Your server is ready to deploy
Execution time: 5.8723s
Saved logs to /var/www/repo/.rocketeer/logs/production--20150301.log

PunchRockgroin avatar Mar 01 '15 18:03 PunchRockgroin

It seems that the check is looking for a composer.json in the /current folder on the remote server. This check also occurs before "setup" so to speak, so setup fails as well.

To be more precise it'll look in current/ but it'll also look into the folder you're deploying from. Are you using Composer as a PHAR or global binary?

Anahkiasen avatar Mar 07 '15 13:03 Anahkiasen

Global.

PunchRockgroin avatar Mar 07 '15 14:03 PunchRockgroin

If you log into the machine and do which composer what do you get?

Anahkiasen avatar Mar 07 '15 14:03 Anahkiasen

[[email protected] ~]$ which composer
/usr/local/bin/composer

PunchRockgroin avatar Mar 07 '15 14:03 PunchRockgroin

I can verify this behaviour is also occurring for me. I'll try tracking down the code that this might be getting effected by.

jaitaiwan avatar May 05 '15 14:05 jaitaiwan

Ok, @Anahkiasen and @PunchRockgroin it appears that Rocketeer returns this ambigous error when not only the binary is missing but also if its manifest (aka composer.json) file is missing either locally or in the destination server.

Probably need a #PR around this to make the error messages much more pointed although I'm not exactly sure how this would be best implemented.

So I think we should close this issue with documentation added around the fact that PackageManagers will fail when they don't have their appropriate manifests, while linking to a new issue which tracks the best way to get a PR happening.

jaitaiwan avatar May 05 '15 15:05 jaitaiwan

@Anahkiasen What can I check to get this resolved?

xtrasmal avatar Jun 23 '15 15:06 xtrasmal

I also ran into this problem. I'm deploying from outside my project folder, so it could not find a composer.json file. To fix it I simply created an empty composer.json file in my local directory. It saves that the setup was successful, so I just deleted the empty composer.json after that initial setup.

pelletiermaxime avatar Oct 07 '15 14:10 pelletiermaxime

Yep... annoying :-) I thought it checks the server, so y is ist checking for a composer.json file in my local directory?

HellPat avatar Jan 13 '16 16:01 HellPat

Yeah, I also found the issue of this ticket. It is missing "composer.json" in both local and remote directory.

If anyone interested in coding explanation, look at into file "Composer.php" which extended from "AbstractPackageManager.php", function "hasManifest", it will throw "false".

/**
 * Check if the manifest file exists, locally or on server.
 *
 * @return bool
 */
public function hasManifest()
{
    $server = $this->paths->getFolder('current/'.$this->manifest);
    $server = $this->bash->fileExists($server);

    $local = $this->app['path.base'].DS.$this->manifest;
    $local = $this->files->exists($local);

    return $local || $server;
}

Kinda make sense to check whether composer runnable by checking binary (composer.phar) and manifest (composer.json) exist. My point is, I hope there is better error messaging to flag there is issue with manifest of the Composer.php.

Thanks Rob

kororo avatar Mar 23 '16 13:03 kororo