Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Toggle Modules Feature Causing Build Failures #681

Closed
mikemadison13 opened this issue Nov 16, 2016 · 2 comments
Closed

Toggle Modules Feature Causing Build Failures #681

mikemadison13 opened this issue Nov 16, 2016 · 2 comments
Labels
Support A support request

Comments

@mikemadison13
Copy link
Contributor

My system information:

  • Operating system type: Mac OS
  • Operating system version: El Capitan
  • BLT version: 8.x.dev (16/11/16)

Output of blt doctor:

blt > doctor:

Changed current directory to /home/vagrant/.composer

+----------------------+----------------------------------------------------------------------------------+
| Property             | Value                                                                            |
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /var/www/capitalcamp/docroot                                                     |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
|  - %config-sync      | /var/www/capitalcamp/config/default                                              |
|  - %files            | sites/default/files                                                              |
|  - %private          | /var/www/capitalcamp/files-private                                               |
|  - %temp             | /tmp                                                                             |
| admin-theme          | seven                                                                            |
| blt-version          | 8.x-dev                                                                          |
| bootstrap            | Successful                                                                       |
| config-sync          | /var/www/capitalcamp/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.2                                                                            |
| drush-alias-files    | /var/www/capitalcamp/docroot/../drush/site-aliases/aliases.drushrc.php           |
|                      | /var/www/capitalcamp/docroot/../drush/site-aliases/capitalcamp.aliases.drushrc.p |
|                      | hp                                                                               |
|                      | /var/www/capitalcamp/docroot/../drush/site-aliases/example.acsf.aliases.drushrc. |
|                      | php                                                                              |
|                      | /var/www/capitalcamp/docroot/../drush/site-aliases/example.local.aliases.drushrc |
|                      | .php                                                                             |
| drush-conf           | /var/www/capitalcamp/drush/drushrc.php                                           |
| drush-script         | /var/www/capitalcamp/vendor/drush/drush/drush.php                                |
| drush-temp           | /tmp                                                                             |
| drush-version        | 9.0.0-alpha1                                                                     |
| files                | sites/default/files                                                              |
| install-profile      |                                                                                  |
| local-drushrc        | /var/www/capitalcamp/docroot/sites/default/local.drushrc.php                     |
| local-settings       | /var/www/capitalcamp/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/capitalcamp/files-private                                               |
| root                 | /var/www/capitalcamp/docroot                                                     |
| site                 | sites/default                                                                    |
| temp                 | /tmp                                                                             |
| theme                | bartik                                                                           |
| themes               | themes                                                                           |
| uri                  | http://local.capitalcamp.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.capitalcamp.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.                                                   |
| 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:root          | Behat drupal_root is set correctly for Drupal VM.                               |
| checkProjectYml:keys     | project.yml has no deprecated keys.                                             |
| checkAcsfConfig          | BLT settings are included in your pre-settings-php include.                     |
| checkDrupalVm:alias      | drush.aliases.local exists your drush aliases file.                             |
| checkDrupalVm            | Drupal VM is configured correctly.                                              |
| checkPhpDateTimezone     | PHP setting for date.timezone is correctly set                                  |
+--------------------------+---------------------------------------------------------------------------------+

When I run this command:

blt local:update

I get the following output:

blt > setup:toggle-modules:

field_ui is already enabled.                                                                                        [ok]
views_ui is already enabled.                                                                                        [ok]
The following extensions will be enabled: dblog, devel, seckit
Do you really want to continue? (y/n): y
exception 'Drupal\Core\Config\PreExistingConfigException' with message 'Configuration objects                    [error]
(seckit.settings) provided by seckit already exist in active configuration' in
/var/www/capitalcamp/docroot/core/lib/Drupal/Core/Config/PreExistingConfigException.php:65

This came out out of the work done on #657. Installs now succeed (good). However, after running an installation, running blt local:update fails because of active configuration in the database.

Scenarios:

  1. Remove all modules from the modules area of project.yml: local:update runs fine
  2. blt local:install => blt local:update (install succeeds, update fails)
  3. blt local:sync => blt local:update =< blt local:update (sync succeeds, update succeeds, update fails)

I can do a Drush status on the module (in this case, seckit) and see that it is disabled. I can attempt to uninstall seckit and it tells me there is nothing to uninstall, but as soon as I attempt to install it, it fails due to the active configuration existing. This may be more of a Drupal core issue or a Drush issue than a BLT issue. However, BLT is still effected by it!

@grasmash
Copy link
Contributor

Yeah, so after thinking about this a bit I can't help but conclude that this is an issue with Drupal core's handling of config.

Take this scenario:

  • Enable acquia_connector, which contains config for dblog.
  • Enable dblog
  • PreExistingConfigException is thrown

This occurs because acquia_connector creates config that dblog then tries to overwrite. I would expect Drupal core to simply ignore the conflicting config in dblog and move on. Barring that, acquia_connector should not export dblog config. There don't seem to be any good solutions here. We can patch acquia_connector, patch core, write a contrib module to handle it.... am I missing an option?

@grasmash grasmash added Enhancement A feature or feature request Support A support request and removed Enhancement A feature or feature request labels Nov 17, 2016
@grasmash
Copy link
Contributor

If you need to override the default configuration provided by another module, available solutions are:

  • Move your config into the a custom profile. Profiles are exempt from the PreExistingConfigException issue.
  • Use a features module. Features will prevent PreExistingConfigException from being thrown when a feature containing pre-existing configuration is installed. I recommend adding a dependency on features in your feature module to ensure that features is actually enabled during installation.
  • Use config rewrite, which will allow you to rewrite the configuration of another module prior to installation.
  • Use the config override system built into core. This has some limitations of which you should be wary.

My recommended approach would be to use features.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support A support request
Projects
None yet
Development

No branches or pull requests

2 participants