acquia / blt

Acquia's toolset for automating Drupal 8 and 9 development, testing, and deployment.
https://docs.acquia.com/blt/
GNU General Public License v2.0
442 stars 394 forks source link

Failed to create database while running a build using Pipelines #1459

Closed jonraedeke closed 7 years ago

jonraedeke commented 7 years ago

I don't know whether this is an issue with how I set up blt or pipelines.

My system information:

Output of blt doctor:

blt > doctor:
Changed current directory to /home/vagrant/.composer
+----------------------+----------------------------------------------------------------------------------+
| Property             | Value                                                                            |
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /var/www/nisteight/docroot                                                       |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
|  - %config-sync      | /var/www/nisteight/config/default                                                |
|  - %files            | sites/default/files                                                              |
|  - %private          | /var/www/nisteight/files-private                                                 |
|  - %temp             | /tmp                                                                             |
| admin-theme          | seven                                                                            |
| blt-version          | 8.8.1                                                                            |
| bootstrap            | Successful                                                                       |
| config-sync          | /var/www/nisteight/config/default                                                |
| db-driver            | mysql                                                                            |
| db-hostname          | localhost                                                                        |
| db-name              | drupal                                                                           |
| db-password          | drupal                                                                           |
| db-port              | 3306                                                                             |
| db-status            | Connected                                                                        |
| db-username          | drupal                                                                           |
| drupal-settings-file | sites/default/settings.php                                                       |
| drupal-version       | 8.3.0                                                                            |
| drush-alias-files    | /var/www/nisteight/docroot/../drush/site-aliases/aliases.drushrc.php             |
|                      | /var/www/nisteight/docroot/../drush/site-aliases/example.acsf.aliases.drushrc.ph |
|                      | p                                                                                |
|                      | /var/www/nisteight/docroot/../drush/site-aliases/example.local.aliases.drushrc.p |
|                      | hp                                                                               |
| drush-conf           | /var/www/nisteight/drush/drushrc.php                                             |
| drush-script         | /var/www/nisteight/vendor/drush/drush/drush.php                                  |
| drush-temp           | /tmp                                                                             |
| drush-version        | 8.1.10                                                                           |
| files                | sites/default/files                                                              |
| install-profile      | lightning                                                                        |
| local-drushrc        | /var/www/nisteight/docroot/sites/default/local.drushrc.php                       |
| local-settings       | /var/www/nisteight/docroot/sites/default/settings/local.settings.php             |
| modules              | modules                                                                          |
| php-bin              | /usr/bin/php                                                                     |
| php-conf             | /etc/php/5.6/cli/php.ini                                                         |
| php-os               | Linux                                                                            |
| private              | /var/www/nisteight/files-private                                                 |
| root                 | /var/www/nisteight/docroot                                                       |
| site                 | sites/default                                                                    |
| temp                 | /tmp                                                                             |
| theme                | bartik                                                                           |
| themes               | themes                                                                           |
| uri                  | default                                                                          |
| 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                 | Site URI is not set                                                             |
|                          |                                                                                 |
|                          | Is $options['uri'] set correctly in                                             |
|                          | /var/www/nisteight/docroot/sites/default/local.drushrc.php?                     |
|                          |                                                                                 |
| 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.                                                   |
| checkNvmExists           | NVM does not exist.                                                             |
|                          |                                                                                 |
|                          | It is recommended that you use NVM to manage multiple versions of NodeJS on one |
|                          | machine.                                                                        |
|                          | Instructions for installing NVM can be found at:                                |
|                          |   https://github.com/creationix/nvm#installation                                |
| 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.                                               |
| checkBehat:uri           | base_url in tests/behat/local.yml does not match the site URI.                  |
|                          |   Behat base_url is set to "http://local.nisteight.com".                        |
|                          |   Drush site URI is set to default.                                             |
| checkProjectYml:keys     | project.yml has no deprecated keys.                                             |
| checkPhpDateTimezone     | PHP setting for date.timezone is correctly set                                  |
+--------------------------+---------------------------------------------------------------------------------+

When I run this command:

pipelines start

I get the following output in the Pipelines UI on Acquia cloud:

blt > drupal:install:
     [echo] Installing Drupal...
You are about to CREATE the 'drupal' database. Do you want to continue? (y/n): y
Failed to create database: ERROR 1045 (28000): Access denied for user    [error]
'drupal'@'localhost' (using password: YES)
[phingcall] /mnt/tmp/local.prod/source/./vendor/acquia/blt/phing/tasks/drupal.xml:15:10: /mnt/tmp/local.prod/source/./vendor/acquia/blt/phing/tasks/drupal.xml:19:29: Drush exited with code 1

BUILD FAILED/mnt/tmp/local.prod/source/./vendor/acquia/blt/phing/tasks/ci.xml:4:22: Execution of the target buildfile failed. Aborting.
; 13.0963 seconds
pipelines_kill_background_processes

And I expected the build to finish successfully.

grasmash commented 7 years ago

This may be related to #1406, the fix for which is present in 8.8.3. I suggest that you upgrade, re-initialize your pipelines file with blt ci:pipelines:init and then try again.

jonraedeke commented 7 years ago

Unfortunately, after updating blt to 8.8.3 and re-initializing the pipelines file, I'm still getting the same point of failure.

blt > doctor:
Changed current directory to /home/vagrant/.composer
+----------------------+----------------------------------------------------------------------------------+
| Property             | Value                                                                            |
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /var/www/nisteight/docroot                                                       |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
|  - %config-sync      | /var/www/nisteight/config/default                                                |
|  - %files            | sites/default/files                                                              |
|  - %private          | /var/www/nisteight/files-private                                                 |
|  - %temp             | /tmp                                                                             |
| admin-theme          | seven                                                                            |
| blt-version          | 8.8.3                                                                            |
| bootstrap            | Successful                                                                       |
| config-sync          | /var/www/nisteight/config/default                                                |
| db-driver            | mysql                                                                            |
| db-hostname          | localhost                                                                        |
| db-name              | drupal                                                                           |
| db-password          | drupal                                                                           |
| db-port              | 3306                                                                             |
| db-status            | Connected                                                                        |
| db-username          | drupal                                                                           |
| drupal-settings-file | sites/default/settings.php                                                       |
| drupal-version       | 8.3.1                                                                            |
| drush-alias-files    | /var/www/nisteight/docroot/../drush/site-aliases/aliases.drushrc.php             |
|                      | /var/www/nisteight/docroot/../drush/site-aliases/example.acsf.aliases.drushrc.ph |
|                      | p                                                                                |
|                      | /var/www/nisteight/docroot/../drush/site-aliases/example.local.aliases.drushrc.p |
|                      | hp                                                                               |
| drush-conf           | /var/www/nisteight/drush/drushrc.php                                             |
| drush-script         | /var/www/nisteight/vendor/drush/drush/drush.php                                  |
| drush-temp           | /tmp                                                                             |
| drush-version        | 8.1.11                                                                           |
| files                | sites/default/files                                                              |
| install-profile      | lightning                                                                        |
| local-drushrc        | /var/www/nisteight/docroot/sites/default/local.drushrc.php                       |
| local-settings       | /var/www/nisteight/docroot/sites/default/settings/local.settings.php             |
| modules              | modules                                                                          |
| php-bin              | /usr/bin/php                                                                     |
| php-conf             | /etc/php/5.6/cli/php.ini                                                         |
| php-os               | Linux                                                                            |
| private              | /var/www/nisteight/files-private                                                 |
| root                 | /var/www/nisteight/docroot                                                       |
| site                 | sites/default                                                                    |
| temp                 | /tmp                                                                             |
| theme                | bartik                                                                           |
| themes               | themes                                                                           |
| uri                  | default                                                                          |
| 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                 | Site URI is not set                                                             |
|                          |                                                                                 |
|                          | Is $options['uri'] set correctly in                                             |
|                          | /var/www/nisteight/docroot/sites/default/local.drushrc.php?                     |
|                          |                                                                                 |
| 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.                                                   |
| checkNvmExists           | NVM does not exist.                                                             |
|                          |                                                                                 |
|                          | It is recommended that you use NVM to manage multiple versions of NodeJS on one |
|                          | machine.                                                                        |
|                          | Instructions for installing NVM can be found at:                                |
|                          |   https://github.com/creationix/nvm#installation                                |
| 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.                                               |
| checkBehat:uri           | base_url in tests/behat/local.yml does not match the site URI.                  |
|                          |   Behat base_url is set to "http://local.nisteight.com".                        |
|                          |   Drush site URI is set to default.                                             |
| checkProjectYml:keys     | project.yml has no deprecated keys.                                             |
| checkPhpDateTimezone     | PHP setting for date.timezone is correctly set                                  |
+--------------------------+---------------------------------------------------------------------------------+

Same error in the Pipelines UI:

blt > drupal:install:
     [echo] Installing Drupal...
You are about to CREATE the 'drupal' database. Do you want to continue? (y/n): y
Failed to create database: ERROR 1045 (28000): Access denied for user    [error]
'drupal'@'localhost' (using password: YES)
[phingcall] /mnt/tmp/local.prod/source/./vendor/acquia/blt/phing/tasks/drupal.xml:15:10: /mnt/tmp/local.prod/source/./vendor/acquia/blt/phing/tasks/drupal.xml:19:29: Drush exited with code 1

BUILD FAILED/mnt/tmp/local.prod/source/./vendor/acquia/blt/phing/tasks/ci.xml:4:22: Execution of the target buildfile failed. Aborting.
; 13.1767 seconds
pipelines_kill_background_processes
grasmash commented 7 years ago

If you're in a Pipelines environment, this file should be loaded: https://github.com/acquia/blt/blob/8.x/settings/pipelines.settings.php#L3

This will set the host to 127.0.0.1. However, it looks drush is trying to use localhost. Have you modified settings.php in some way? The suggestion is that you only require BLT's settings file.

jonraedeke commented 7 years ago

That was it, I'm not sure why settings.php was customized but it was. Many thanks!