0

I installed drush via Composer. I am using drush 9.5.2 with Drupal 8.6.4.

I mention that everything is fine on local. However, in a docker instance in GitLab CI, when I execute vendor/bin/drush updatedb -y -vvv, I get:

 [preflight] Config paths: /builds/v2/my-project/vendor/drush/drush/drush.yml,/builds/v2/my-project/drush/drush.yml
 [preflight] Alias paths: /builds/v2/my-project/web/drush/sites,/builds/v2/my-project/drush/sites
 [preflight] Commandfile search paths: /builds/v2/my-project/vendor/drush/drush/src,/builds/v2/my-project/drush
 [bootstrap] Starting bootstrap to full [0.09 sec, 8.27 MB]
 [bootstrap] Drush bootstrap phase 5 [0.09 sec, 8.27 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.09 sec, 8.27 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.09 sec, 8.27 MB]
 [bootstrap] Try to bootstrap at phase 5 [0.09 sec, 8.4 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.09 sec, 8.4 MB]
 [bootstrap] Change working directory to /builds/v2/my-project/web [0.09 sec, 8.4 MB]
 [bootstrap] Initialized Drupal 8.6.4 root directory at /builds/v2/my-project/web [0.1 sec, 8.4 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.1 sec, 8.4 MB]
 [bootstrap] Try to bootstrap at phase 5 [0.1 sec, 8.92 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.1 sec, 8.92 MB]
 [bootstrap] Initialized Drupal site default at sites/default [0.1 sec, 8.92 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.1 sec, 8.92 MB]
 [bootstrap] Try to bootstrap at phase 5 [0.1 sec, 8.92 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.1 sec, 8.92 MB]
 [debug] Add service modifier [0.11 sec, 9.14 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.11 sec, 9.14 MB]
 [info] sql-query: SELECT 1; [0.11 sec, 9.28 MB]
 [info] Executing: mysql --defaults-file=/tmp/drush_FfJCYU --database=my_project --host=xxx.rds.amazonaws.com --port=3306 --silent -A < /tmp/drush_BsP1AL > /dev/null [0.11 sec, 9.28 MB]
 [info] sql-query: SELECT 1 FROM key_value LIMIT 1; [0.23 sec, 9.28 MB]
 [info] Executing: mysql --defaults-file=/tmp/drush_TOHYme --database=my_project --host=xxx.rds.amazonaws.com --port=3306 --silent -A < /tmp/drush_4SNKF4 > /dev/null [0.23 sec, 9.28 MB]
 [notice] Missing database table: key_value [0.35 sec, 9.28 MB]
 [bootstrap] Could not bootstrap at phase 5 [0.35 sec, 9.28 MB]

In BootstrapHook.php line 32:

  [Exception]                                                         
  Bootstrap failed. Run your command with -vvv for more information.  


Exception trace:
 () at /builds/v2/my-project/vendor/drush/drush/src/Boot/BootstrapHook.php:32
 Drush\Boot\BootstrapHook->initialize() at /builds/v2/my-project/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /builds/v2/my-project/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /builds/v2/my-project/vendor/consolidation/annotated-command/src/CommandProcessor.php:117
 Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /builds/v2/my-project/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:391
 Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /builds/v2/my-project/vendor/symfony/console/Command/Command.php:221
 Symfony\Component\Console\Command\Command->run() at /builds/v2/my-project/vendor/symfony/console/Application.php:971
 Symfony\Component\Console\Application->doRunCommand() at /builds/v2/my-project/vendor/symfony/console/Application.php:248
 Symfony\Component\Console\Application->doRun() at /builds/v2/my-project/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /builds/v2/my-project/vendor/drush/drush/src/Runtime/Runtime.php:112
 Drush\Runtime\Runtime->doRun() at /builds/v2/my-project/vendor/drush/drush/src/Runtime/Runtime.php:41
 Drush\Runtime\Runtime->run() at /builds/v2/my-project/vendor/drush/drush/drush.php:66
 require() at /builds/v2/my-project/vendor/drush/drush/drush:4

updatedb [--cache-clear [CACHE-CLEAR]] [--entity-updates] [--post-updates [POST-UPDATES]] [--no-cache-clear] [--no-post-updates] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--notify [NOTIFY]] [--druplicon] [--] <command>

I mention that the command mysql -V is working.

And when I execute vendor/bin/drush sql:connect -vvv, I get:

 [preflight] Config paths: /builds/v2/my-project/vendor/drush/drush/drush.yml,/builds/v2/my-project/drush/drush.yml
 [preflight] Alias paths: /builds/v2/my-project/web/drush/sites,/builds/v2/my-project/drush/sites
 [preflight] Commandfile search paths: /builds/v2/my-project/vendor/drush/drush/src,/builds/v2/my-project/drush
 [bootstrap] Starting bootstrap to max [0.1 sec, 8.27 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.1 sec, 8.4 MB]
 [bootstrap] Change working directory to /builds/v2/my-project/web [0.1 sec, 8.4 MB]
 [bootstrap] Initialized Drupal 8.6.4 root directory at /builds/v2/my-project/web [0.1 sec, 8.4 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.11 sec, 8.92 MB]
 [bootstrap] Initialized Drupal site default at sites/default [0.11 sec, 8.92 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.11 sec, 8.92 MB]
 [debug] Add service modifier [0.11 sec, 9.11 MB]
mysql --user=my_project --password=xxx --database=my_project --host=xxx.rds.amazonaws.com --port=3306 -A

So, no problem with drush sql:connect.

Does the notice "Missing database table: key_value" could cause the issue?
How could we troubleshoot the issue?

Just in case, here is the build part of my gitlab-ci.yml:

build:
  stage: build

  before_script:
    - apt-get update

    #install additional gd extension, that is required by Drupal
    - apt-get install libpng-dev -y
    - docker-php-ext-install gd

    #install mysql-cli
    - apt-get install -y mysql-client

    #install composer
    - apt-get install zip unzip
    - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    - php composer-setup.php
    - php -r "unlink('composer-setup.php');"

    #install composer package to run parallel tasks
    - composer -n global require -n "hirak/prestissimo"

  script:
    - mysql -V
    - php composer.phar install
    - vendor/bin/drush
    - vendor/bin/drush sql:connect -vvv
    - vendor/bin/drush updatedb -y -vvv
    - vendor/bin/drush config-import -y
    - vendor/bin/drush cache-rebuild -y
0

To fix the issue I had to export my local database and import it in the production server database (same for the sync configuration files).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.