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

Module schemas are not installed when enabling a module via config when running blt deploy #718

Closed
ba66e77 opened this issue Nov 30, 2016 · 10 comments
Labels
Bug Something isn't working

Comments

@ba66e77
Copy link
Contributor

ba66e77 commented Nov 30, 2016

Problem summary

I installed and configured the Redirect module on my local environment, exported config and ran blt deploy to push the code up. The deploy command completed successfully, but the environment throws errors because the table which the module defines is not present in the database.

The config for the module was imported though, and core.extension shows the module as enabled. Drush pmi shows the module as not installed though. Attempting run drush en says the module is enabled. Running drush pm-uninstall says it is not enabled.

In testing, when I overrode the setup:update target to not run the config-imports and instead ran config-import manually when the deploy was complete, the table was installed and the module worked as expected.

My system information:

  • Operating system type: OSX
  • Operating system version:10.11.6
  • BLT version: 8.5.2

Output of blt doctor:

blt > doctor:

Changed current directory to /home/vagrant/.composer
+----------------------+----------------------------------------------------------------------------------+
|�[32m Property             �[39m|�[32m Value                                                                            �[39m|
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /var/www/eebsmith/docroot                                                        |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
|  - %config-sync      | /var/www/eebsmith/config/default                                                 |
|  - %files            | sites/default/files                                                              |
|  - %private          | /var/www/eebsmith/files-private                                                  |
|  - %temp             | /tmp                                                                             |
| admin-theme          | seven                                                                            |
| blt-version          | 8.5.2                                                                            |
| bootstrap            | Successful                                                                       |
| config-sync          | /var/www/eebsmith/config/default                                                 |
| db-driver            | mysql                                                                            |
| db-hostname          | localhost                                                                        |
| db-name              | drupal                                                                           |
| db-password          | drupal                                                                           |
| db-port              | 3306                                                                             |
| db-username          | drupal                                                                           |
| drupal-settings-file | sites/default/settings.php                                                       |
| drupal-version       | 8.2.3                                                                            |
| drush-alias-files    | /var/www/eebsmith/docroot/../drush/site-aliases/aliases.drushrc.php              |
|                      | /var/www/eebsmith/docroot/../drush/site-aliases/example.acsf.aliases.drushrc.php |
|                      | /var/www/eebsmith/docroot/../drush/site-aliases/example.local.aliases.drushrc.ph |
|                      | p                                                                                |
| drush-conf           | /var/www/eebsmith/drush/drushrc.php                                              |
| drush-script         | /var/www/eebsmith/vendor/drush/drush/drush.php                                   |
| drush-temp           | /tmp                                                                             |
| drush-version        | 9.0.0-alpha1                                                                     |
| files                | sites/default/files                                                              |
| install-profile      | lightning                                                                        |
| local-drushrc        | /var/www/eebsmith/docroot/sites/default/local.drushrc.php                        |
| local-settings       | /var/www/eebsmith/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/eebsmith/files-private                                                  |
| root                 | /var/www/eebsmith/docroot                                                        |
| site                 | sites/default                                                                    |
| temp                 | /tmp                                                                             |
| theme                | bartik                                                                           |
| themes               | themes                                                                           |
| uri                  | http://local.datasmith.net                                                       |
| user                 |                                                                                  |
+----------------------+----------------------------------------------------------------------------------+
+--------------------------+----------------------------------------------------------------------------------+
|�[32m Check                    �[39m|�[32m Outcome                                                                          �[39m|
+--------------------------+----------------------------------------------------------------------------------+
| �[32mcheckDocrootExists�[39m       | Found docroot.                                                                   |
| �[32mcheckCoreExists�[39m          | Drupal core exists                                                               |
| �[32mcheckSettingsFile�[39m        | BLT settings are included in settings file.                                      |
| �[32mcheckLocalSettingsFile�[39m   | Found your local settings file.                                                  |
| �[32mcheckLocalDrushFile�[39m      | Found your local drush settings file.                                            |
| �[32mcheckUri�[39m                 | $options['uri'] is set.                                                          |
| �[32mcheckUriResponse�[39m         | Received a response from site http://local.datasmith.net.                        |
| �[32mcheckFileSystem:%files�[39m   | Public files directory is writable.                                              |
| �[32mcheckFileSystem:%private�[39m | Private files directory is writable.                                             |
| �[32mcheckFileSystem:%temp�[39m    | Temporary files directory is writable.                                           |
| �[32mcheckDbConnection�[39m        | Connected to database.                                                           |
| �[32mcheckDrupalBootstrapped�[39m  | Bootstrapped Drupal via drush.                                                   |
| �[32mcheckDrupalInstalled�[39m     | Drupal is installed.                                                             |
| �[32mcheckCaching:page�[39m        | Drupal cache is disabled.                                                        |
| �[32mcheckCaching:css�[39m         | CSS preprocessing is disabled.                                                   |
| �[32mcheckCaching:js�[39m          | JS preprocessing is disabled.                                                    |
| �[37;41mcheckNvmExists�[39;49m           | 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                                 |
| �[32mcheckComposer:require�[39m    | acquia/blt is in composer.json's require object.                                 |
| �[32mcheckComposer:plugins�[39m    | hirak/prestissimo plugin for composer is installed.                              |
| �[32mcheckBehat:exists�[39m        | Behat local settings file exists.                                                |
| �[37;41mcheckBehat:root�[39;49m          | You have DrupalVM initialized, but drupal_root in tests/behat/local.yml does not |
|                          | reference the DrupalVM docroot.                                                  |
|                          |   Behat drupal_root is /Users/barrett.smith/Desktop/eebsmith/docroot.            |
|                          |   To resolve, remove tests/behat/local.yml, ssh into the VM, and run blt         |
|                          | setup:behat.                                                                     |
| �[32mcheckProjectYml:keys�[39m     | project.yml has no deprecated keys.                                              |
| �[32mcheckAcsfConfig�[39m          | BLT settings are included in your pre-settings-php include.                      |
| �[32mcheckDrupalVm:alias�[39m      | drush.aliases.local exists your drush aliases file.                              |
| �[32mcheckDrupalVm�[39m            | Drupal VM is configured correctly.                                               |
| �[32mcheckPhpDateTimezone�[39m     | PHP setting for date.timezone is correctly set                                   |
+--------------------------+----------------------------------------------------------------------------------+

@malikkotob
Copy link
Contributor

I ran into the same issue, but with the flag module. I haven't debugged to the point where I overrode the setup:update target and ran config import manually, but can try that out tonight.

@danepowell
Copy link
Contributor

I'm pretty sure this is an upstream bug with how Drush handles the --partial options for config-import. There have been a few reports: https://github.com/drush-ops/drush/issues?utf8=%E2%9C%93&q=is%3Aissue%20config-import%20partial%20is%3Aclosed%20

My understanding was that it was fixed in newer versions of Drush though.

@ba66e77
Copy link
Contributor Author

ba66e77 commented Nov 30, 2016

Hmm. That issue in the drush queue certainly describes what I'm seeing, but I'm running drush 9.0.0-alpha1 and the issue was supposedly fixed in 8.1.0 drush-ops/drush#2069 (comment)

edit but 9.0.0-alpha1 is older than 8.1.0. Sigh.

Ok, I'm closing this issue since it seems the fault is not with BLT.

@ba66e77 ba66e77 closed this as completed Nov 30, 2016
@danepowell
Copy link
Contributor

Thanks for digging into the version issue. I was pretty confused as well, but that would explain it.

@grasmash this has probably been rehashed endlessly, but do you think BLT should ship Drush 8 instead of Drush 9? Or maybe we should pester the Drush maintainers to roll 9.0.0-alpha2.

@ba66e77
Copy link
Contributor Author

ba66e77 commented Dec 1, 2016

It looks like Lightning requires Drush 9. I don't see that BLT defines a specific version dependency.

I've pinged the Lightning maintainers to see if it's viable for them to use drush 8 instead: https://github.com/acquia/lightning/issues/233

@danepowell
Copy link
Contributor

We do declare drush as a dependency. Projects are welcome to change that individually, although I think we have to stay in step with Lightning.
https://github.com/acquia/blt/blob/8.x/template/composer.json#L24

@danepowell
Copy link
Contributor

danepowell commented Dec 1, 2016

Actually it looks like Lightning just downgraded, so maybe we should too. I'll reopen this issue so it stays on the radar.

@grasmash seems like we should downgrade Drush to 8.x

@danepowell danepowell reopened this Dec 1, 2016
@grasmash
Copy link
Contributor

grasmash commented Dec 2, 2016

I would like to downgrade to Drush 8. I believe I ran into Drupal Console related issues when doing so.

grasmash added a commit to grasmash/bolt that referenced this issue Dec 2, 2016
@grasmash grasmash added Bug Something isn't working and removed Bug Something isn't working labels Dec 2, 2016
@bobbygryzynger
Copy link
Contributor

bobbygryzynger commented Dec 2, 2016

I can also confirm I'm seeing this issue while deploying to Acquia remote environments. Although I'm seeing it manifest when simply updating configuration values.

I get the following output on the Workflow console:

[16:41:37] [16:41:37] Started

[16:41:51] [2016-12-02 16:41:46] Starting hook: post-code-update
[2016-12-02 16:41:46] Executing: /mnt/users/[removed]/dev.shell /var/www/html/[removed].dev/hooks/common/post-code-update/post-code-update.sh [removed] dev master master [removed].git git < /dev/null (as [removed])
Running updates for environment: dev
Buildfile: /var/www/html/[removed]/vendor/acquia/blt/phing/build.xml

blt > deploy:update:


blt > setup:update:


blt > setup:toggle-modules:

acquia_connector is already enabled.                                        [ok]
shield is already enabled.                                                  [ok]
There were no extensions that could be enabled.                             [ok]
Extension devel was not found and will not be uninstalled.             [warning]
field_ui is already uninstalled.                                            [ok]
views_ui is already uninstalled.                                            [ok]
There were no extensions that could be uninstalled.                         [ok]
 Collection  Config           Operation 
             shield.settings  update
Import the listed configuration changes? (y/n): 
y
Argument 1 passed to _drush_config_import_partial() must be an           [error]
instance of Drupal\Core\Config\FileStorage, instance of
Drush\Config\StorageWrapper given, called in
/mnt/www/html/[removed]/vendor/drush/drush/includes/drush.inc
on line 725 and defined config.drush.inc:687
E_RECOVERABLE_ERROR encountered; aborting. To ignore recoverable         [error]
errors, run again with --no-halt-on-error
Drush command terminated abnormally due to an unrecoverable error.       [error]
[phingcall] /var/www/html/octagon.dev/vendor/acquia/blt/phing/tasks/setup.xml:244:32: Drush exited with code 255

BUILD FAILED
/var/www/html/[removed].dev/vendor/acquia/blt/phing/tasks/deploy.xml:161:22: Execution of the target buildfile failed. Aborting.

Total time: 4.0136 seconds

Update errored.
Finished updates for environment: dev
[2016-12-02 16:41:51] Finished hook: post-code-update

@grasmash grasmash added the Bug Something isn't working label Dec 6, 2016
@grasmash
Copy link
Contributor

BLT has been downgraded to Drush 8 by default. This should resolve this issue.

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

5 participants