Since aegir3.3, when I install aegir 3.3, the install fails, while it worked previously. I install with chef on my servers with the aegir3 cookbook.

The only meaningful item in the output is:
sh: 1: drush: not found

Output before that below.
I think it has to do with the install working with composer, which actually installs in .config/composer ... instead of .composer. Which makes sure that the entry in .bashrc is incorrect ,and also the symlink from /usr/local/bin
My guess would be the failure is in the lines

        # Install Drush.
        su -c "composer global require drush/drush:$DRUSH_VERSION" aegir
Creating config file /etc/sudoers.d/aegir with new version
All settings correct for using Composer
Downloading...
aegir1.production.imindsx.org
Composer successfully installed to: //composer.phar
Use it: php composer.phar
Changed current directory to /var/aegir/.config/composer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing pear/console_table (v1.2.1)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing symfony/polyfill-mbstring (v1.1.0)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing symfony/var-dumper (v2.8.2)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing symfony/yaml (v2.7.9)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing jakub-onderka/php-console-color (0.1)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing dnoegel/php-xdg-base-dir (0.1)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing nikic/php-parser (v2.0.0)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing symfony/console (v3.0.1)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing psy/psysh (v0.6.1)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing psr/log (1.0.0)
    Downloading: 100%
aegir1.production.imindsx.org
  - Installing drush/drush (8.0.2)
    Downloading: 100%
aegir1.production.imindsx.org
pear/console_table suggests installing pear/Console_Color2 (>=0.1.2)
symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
drush/drush suggests installing drush/config-extra (Provides configuration workflow commands, such as config-merge.)
Writing lock file
Generating autoload files
aegir1.production.imindsx.org
Creating config file /etc/php5/apache2/php.ini with new version
php5_invoke json: already enabled for apache2 SAPI
php5_invoke gd: already enabled for apache2 SAPI
php5_invoke mysqli: already enabled for apache2 SAPI
php5_invoke pdo_mysql: already enabled for apache2 SAPI
php5_invoke pdo: already enabled for apache2 SAPI
php5_invoke opcache: already enabled for apache2 SAPI
php5_invoke readline: already enabled for apache2 SAPI
php5_invoke mysql: already enabled for apache2 SAPI
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php5
sh: 1: drush: not found

Comments

daften created an issue. See original summary.

JimCraner’s picture

Confirming the same problem on a fresh Ubuntu 14.04 following the package-installation-option instructions here: https://aegir.readthedocs.org/en/3.x/install/

After the failure, I installed Drush 8 globally, then ran "apt-get install aegir3" to resume the Aegir config process which appears to have completed successfully (I think :-)

daften’s picture

Thanks for the workaround, I'll try it.
Did you install globally with the default method (wget; move, chmod a+x)?

ergonlogic’s picture

I suggest that, for Drush 8+, we simply download and symlink the phar. We should be able to switch easily enough based on version, and keep the existing behaviour for older versions. This would be around this part of the debian scripts: http://cgit.drupalcode.org/provision/tree/debian/aegir3-provision.postin...

ergonlogic’s picture

Having just manually tested installing aegir3-provision, I can confirm that 'drush' is not available.

ergonlogic’s picture

Drush is however installed in /var/aegir/.config/composer/vendor/drush/drush. I just pushed an initial fix that just points to the new location to which Composer installed Drush. Let's see if that resolves the immediate problem.

Note that our tests were affected by https://github.com/composer/composer/issues/4789. to the extent that we can remove Composer as a dependency here, the better, as far as I'm concerned. Since Drush is available as a .phar now, I'd still like to move to that deployment mechanism.

ergonlogic’s picture

The latest unstable build includes this fix, and works as expected.

ergonlogic’s picture

We're planning to also fix #2625168: Drush master changed logging over the weekend, and put out a 3.4 release addressing this on Monday. I'll look into moving to the drush.phar as well.

ergonlogic’s picture

By the way, there's a very simple work-around:

sudo ln -s /var/aegir/.config/composer/vendor/bin/drush /usr/local/bin/drush

Then re-install: sudo apt-get install aegir3

helmo’s picture

I'm not sure it's fixed ....
These two jobs are still failing.
http://ci.aegirproject.org/view/Debian%20dev%20builds/job/D_aegir3-debia...
http://ci.aegirproject.org/view/Upgrades/job/U_aegir_7.x-3.x-stable-to-u...

Looking in the composer sources I see a reference to XDG_CONFIG_HOME on the only place "~/.config/composer" is used ... in many other places they still mention "~/.composer/"

helmo’s picture

@ergonlogic I think need to revert your commit.

ergonlogic’s picture

By all means, go right ahead if you have a better fix.

  • helmo committed 4eb2a45 on
    Issue #2661474: Set COMPOSER_HOME hoping to bypass variations from...
helmo’s picture

Hope this new commits works ... I'll see the results tomorrow morning.

daften’s picture

Excellent news here so far. The workaround works, and I'll be very glad if a 3.4 release could be made quickly so installs work out of the box.
Thanks so much!

ergonlogic’s picture

Status: Active » Fixed

We're using phars for Drush 8+, which is the default now, composer otherwise.

please re-open if you see any further problems with Debian/Ubuntu installs.

mengi’s picture

I installed Aegir 3.4 today and received some warnings and errors.

The install seems to be successful and the hostmaster site works but on the initial import task of the hostmaster site and the initial verify task of the hostmaster web server I got a warning;

array_flip(): Can only flip STRING and INTEGER values! entity.inc:175	
-
array_flip(): Can only flip STRING and INTEGER values! entity.inc:388

All verify tasks will fail with the error;

The drush command 'provision-save @server_master' could not be found. Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.	
-
Drush command terminated abnormally due to an unrecoverable error. Error: Call to undefined function provision_backend_invoke() in /var/aegir/hostmaster-7.x-3.4/profiles/hostmaster/modules/aegir/hosting/task.hosting.inc, line 136
mengi’s picture

Version: 7.x-3.3 » 7.x-3.4
Status: Fixed » Active
mengi’s picture

Status: Active » Fixed

Not sure what happened different, but I got it to work.

I ran the command on post #9 but received this error;

ln: failed to create symbolic link '/usr/local/bin/drush': File exists

Then I ran 'apt-get update' and 'apt-get install aegir3' again and it seemed to reinstall hostmaster and provision.

The following extra packages will be installed:
  aegir3-hostmaster aegir3-provision
The following NEW packages will be installed:
  aegir3 aegir3-hostmaster aegir3-provision

Now servers and sites verify correctly and everything seems to be working fine.

daften’s picture

A bit late, but this was fixed perfectly. I was able to install fresh servers the same day. Excellent work and thanks so much to everybody involved!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.