0

I am attempting to run cron via crontab on a server that has a remote database, as such there is no mysql isntance installed locally.

When attempting to run the command drush core-cron i received the following error.

[warning] The command 'mysql' is required for preflight but cannot be found.

The full debug output is below

debug] Bootstrap further to find core-cron
 [debug] Trying to bootstrap as far as we can
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot()
 [bootstrap] Change working directory to /var/www/wwwroot/web
 [bootstrap] Initialized Drupal 8.5.3 root directory at /var/www/wwwroot/web
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite()
 [bootstrap] Initialized Drupal site default at sites/default
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration()
 [debug] Add service modifier
 [warning] The command 'mysql' is required for preflight but cannot be found. Please install it and retry.
 [debug] Bootstrap phase bootstrapDrupalDatabase() failed to validate; continuing at bootstrapDrupalConfiguration()
 [debug] Done with bootstrap max in Application::find(): trying to find core-cron again.

In Application.php line 238:

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command core-cron was not found. Drush was unable to query the database. As
   a result, many commands are unavailable. Re-run your command with --debug
  to see relevant log messages.


Exception trace:
 Drush\Application->bootstrapAndFind() at /var/www/wwwroot/vendor/drush/drush/src/Application.php:191
 Drush\Application->find() at /var/www/wwwroot/vendor/symfony/console/Application.php:229
 Symfony\Component\Console\Application->doRun() at /var/www/wwwroot/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/wwwroot/vendor/drush/drush/src/Runtime/Runtime.php:112
 Drush\Runtime\Runtime->doRun() at /var/www/wwwroot/vendor/drush/drush/src/Runtime/Runtime.php:41
 Drush\Runtime\Runtime->run() at /var/www/wwwroot/vendor/drush/drush/drush.php:66
 require() at /var/www/wwwroot/vendor/drush/drush/includes/preflight.inc:17
 drush_main() at phar:///usr/local/bin/drush/bin/drush.php:141
 require() at /usr/local/bin/drush:10
  • 1
    It looks like the error message is about a missing local mysql client. You can install that without setting up a local server. – Andy Jun 25 '18 at 9:20
  • This was indeed resolved by adding a mysql client, which was a shame to have to include in the docker container but seems necessary in order to use drush. – Rob Holmes Jun 26 '18 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.