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

blt doctor failing (or drush in vagrant issue) #1617

Closed
simesy opened this issue Jun 7, 2017 · 6 comments
Closed

blt doctor failing (or drush in vagrant issue) #1617

simesy opened this issue Jun 7, 2017 · 6 comments
Assignees
Labels
Bug Something isn't working

Comments

@simesy
Copy link

simesy commented Jun 7, 2017

tldr - does blt doctor work for anyone else out of the box against HEAD? I reproduced this with a fresh BLT, but that may be PEBCAK. If I can confirm this is not just a me problem that would be a great start!

UPDATE: Having some other Drush command issues where Drush can't identify the Drupal site inside vagrant - added information in comments.

My system information:

  • Operating system type: OSX
  • BLT version: HEAD at a6248ac

Output of blt doctor:

[Acquia\Blt\Robo\Tasks\DrushTask] Running /Users/si/Dev/stryker/vendor/bin/drush @stryker.local cc drush --uri=default --yes in /Users/si/Dev/stryker/docroot
'drush' cache was cleared.                                                                                                                                               [success]
[Acquia\Blt\Robo\Tasks\DrushTask] Done in 1.189s
Attempting to run doctor on host machine...
[Acquia\Blt\Robo\Tasks\DrushTask]  The drush command 'blt-doctor' could not be found.  Run `drush           [error]
cache-clear drush` to clear the commandfile cache if you have
installed new extensions.
[Acquia\Blt\Robo\Tasks\DrushTask]  Exit code 1
[warning] Unable to run the doctor using alias '@stryker.local'. Trying with '@self'...
[warning] Unable to run the doctor using alias '@self'. Trying without alias...
[error]

I expected to be able to run blt doctor of course.

@simesy
Copy link
Author

simesy commented Jun 7, 2017

If I go into the VM and run this it works:

/var/www/stryker/vendor/drush/drush/drush.php blt-doctor \
  --uri="http://local.stryker.com" \
  --config="/var/www/stryker/drush/drushrc.php" \
  --root=/var/www/stryker/docroot \
  --alias-path="/var/www/stryker/drush/site-aliases"

Output

+----------------------+----------------------------------------------------------------------------------+
| Property             | Value                                                                            |
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /var/www/stryker/docroot                                                         |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
|  - %config-sync      | /var/www/stryker/config/default                                                  |
|  - %files            | sites/default/files                                                              |
|  - %private          | /var/www/stryker/files-private                                                   |
|  - %temp             | /tmp                                                                             |
| admin-theme          | seven                                                                            |
| blt-version          | 8.x-dev                                                                          |
| bootstrap            | Successful                                                                       |
| config-sync          | /var/www/stryker/config/default                                                  |
| db-driver            | mysql                                                                            |
| db-hostname          | localhost                                                                        |
| db-name              | default                                                                          |
| db-password          | drupal                                                                           |
| db-port              | 3306                                                                             |
| db-status            | Connected                                                                        |
| db-username          | drupal                                                                           |
| drupal-settings-file | sites/default/settings.php                                                       |
| drupal-version       | 8.3.2                                                                            |
| drush-alias-files    | /var/www/stryker/drush/site-aliases/aliases.drushrc.php                          |
|                      | /var/www/stryker/drush/site-aliases/example.acsf.aliases.drushrc.php             |
|                      | /var/www/stryker/drush/site-aliases/example.local.aliases.drushrc.php            |
|                      | /var/www/stryker/drush/site-aliases/ffa01.aliases.drushrc.php                    |
|                      | /var/www/stryker/docroot/../drush/site-aliases/aliases.drushrc.php               |
|                      | /var/www/stryker/docroot/../drush/site-aliases/example.acsf.aliases.drushrc.php  |
|                      | /var/www/stryker/docroot/../drush/site-aliases/example.local.aliases.drushrc.php |
|                      | /var/www/stryker/docroot/../drush/site-aliases/ffa01.aliases.drushrc.php         |
| drush-conf           | /var/www/stryker/vendor/acquia/blt/drush/drushrc.php                             |
|                      | /var/www/stryker/drush/drushrc.php                                               |
| drush-script         | /var/www/stryker/vendor/drush/drush/drush.php                                    |
| drush-temp           | /tmp                                                                             |
| drush-version        | 8.1.12                                                                           |
| files                | sites/default/files                                                              |
| install-profile      | lightning                                                                        |
| local-drushrc        | /var/www/stryker/docroot/sites/default/local.drushrc.php                         |
| local-settings       | /var/www/stryker/docroot/sites/default/settings/local.settings.php               |
| modules              | modules                                                                          |
| php-conf             | /etc/php/5.6/cli/php.ini                                                         |
| php-os               | Linux                                                                            |
| private              | /var/www/stryker/files-private                                                   |
| root                 | /var/www/stryker/docroot                                                         |
| site                 | sites/default                                                                    |
| temp                 | /tmp                                                                             |
| theme                | fhtheme                                                                          |
| themes               | themes                                                                           |
| uri                  | http://local.stryker.com                                                         |
| user                 |                                                                                  |
+----------------------+----------------------------------------------------------------------------------+
+--------------------------+---------------------------------------------------------+
| Check                    | Outcome                                                 |
+--------------------------+---------------------------------------------------------+
| checkDocrootExists       | Found docroot.                                          |
| checkCoreExists          | Drupal core exists                                      |
| checkSettingsFile        | BLT settings are included in settings file.             |
| checkLocalSettingsFile   | Found your local settings file.                         |
| checkLocalDrushFile      | Found your local drush settings file.                   |
| checkUri                 | $options['uri'] is set.                                 |
| checkUriResponse         | Received a response from site http://local.stryker.com. |
| checkFileSystem:%files   | Public files directory is writable.                     |
| checkFileSystem:%private | Private files directory is writable.                    |
| checkFileSystem:%temp    | Temporary files directory is writable.                  |
| checkDbConnection        | Connected to database.                                  |
| checkDrupalBootstrapped  | Bootstrapped Drupal via drush.                          |
| checkDrupalInstalled     | Drupal is installed.                                    |
| checkCaching:page        | Drupal cache is disabled.                               |
| checkCaching:css         | CSS preprocessing is disabled.                          |
| checkCaching:js          | JS preprocessing is disabled.                           |
| checkCiConfig            | Git remotes are set in project.yml.                     |
| checkComposer:require    | acquia/blt is in composer.json's require object.        |
| checkComposer:plugins    | hirak/prestissimo plugin for composer is installed.     |
| checkBehat:exists        | Behat local settings file exists.                       |
| checkProjectYml:keys     | project.yml has no deprecated keys.                     |
| checkPhpDateTimezone     | PHP setting for date.timezone is correctly set          |
+--------------------------+---------------------------------------------------------+

@simesy
Copy link
Author

simesy commented Jun 7, 2017

Contents of ./drush/drushrc.php

<?php
// Load a drushrc.php configuration file from the current working directory.
$options['config'][] = realpath(__DIR__ . '/../vendor/acquia/blt/drush/drushrc.php');

if (file_exists(__DIR__ . '/../docroot/sites/default/local.drushrc.php')) {
  require __DIR__ . '/../docroot/sites/default/local.drushrc.php';
}

Contents of drush.wrapper

#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "`dirname $0`"

if [ ! -f "${DIR}/vendor/drush/drush/drush.launcher" ]; then
  echo >&2 "Drush was not found in this project's vendor directory. You can install it by typing:"
  echo >&2 "composer install"
  exit 1
fi

vendor/drush/drush/drush.launcher --config="${DIR}/drush/drushrc.php" --alias-path="${DIR}/drush/site-aliases" "$@"

Contents of aliases

<?php

// Default environment.
$aliases['stryker.local'] = [
  'root' => '/var/www/stryker/docroot',
  'uri' => 'http://local.stryker.com',
];

// Add remote connection options when alias is used outside VM.
if ('vagrant' != $_SERVER['USER']) {
  $aliases['stryker.local'] += [
    'remote-host' => 'local.stryker.com',
    'remote-user' => 'vagrant',
    'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key'
  ];
}

@simesy simesy changed the title blt doctor failing on HEAD blt doctor failing (or drush in vagrant issue) Jun 7, 2017
@grasmash
Copy link
Contributor

grasmash commented Jun 7, 2017

Was this addressed by #1619?

@grasmash grasmash added the Bug Something isn't working label Jun 7, 2017
@simesy
Copy link
Author

simesy commented Jun 7, 2017

Nah. Is it happening for you?

@grasmash
Copy link
Contributor

grasmash commented Jun 7, 2017

Yes I can reproduce it. I suspect that this is due to a recent upstream change in Robo, which affects how result output is displayed. Will look into it.

@grasmash
Copy link
Contributor

grasmash commented Jun 8, 2017

@simesy It was not happening for me, but I may have found the cause.

Can you confirm whether this has been addressed by #1620?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants