I've installed and uninstalled the Display Suite and Display Suite Extras module once. Now I can't install it again. Every time I try I get following error: Unable to install Display Suite Extras, core.entity_view_mode.node.revision already exists in active configuration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jacekrszewczyk created an issue. See original summary.

drupalfox’s picture

Assigned: Unassigned » drupalfox
finkenmann’s picture

I got the exact same Message and i'm unable to activate the DS Extra Module in my Base Drupal8 Installation. After that error i've uninstalled all Contrib Modules and reinstalled DS again. Again i got en error, but with drush i've got much more detailed information, but i'm afraid to do anything in these files.

exception 'Drupal\Core\Config\PreExistingConfigException' with       [error]
message 'Configuration objects (core.entity_view_mode.node.revision)
provided by ds_extras already exist in active configuration' in
/Users/pierre/sites-dev/30_base_installs/d8-base/core/lib/Drupal/Core/Config/PreExistingConfigException.php:70
Stack trace:
#0
/Users/pierre/sites-dev/30_base_installs/d8-base/core/lib/Drupal/Core/Config/ConfigInstaller.php(465):
Drupal\Core\Config\PreExistingConfigException::create('ds_extras',
Array)
#1
/Users/pierre/sites-dev/30_base_installs/d8-base/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php(136):
Drupal\Core\Config\ConfigInstaller->checkConfigurationToInstall('module',
'ds_extras')
#2
/Users/pierre/sites-dev/30_base_installs/d8-base/core/lib/Drupal/Core/Extension/ModuleInstaller.php(146):
Drupal\Core\ProxyClass\Config\ConfigInstaller->checkConfigurationToInstall('module',
'ds_extras')
#3
/Users/pierre/sites-dev/30_base_installs/d8-base/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(87):
Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#4
/Users/pierre/.composer/vendor/drush/drush/commands/core/drupal/environment.inc(131):
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array,
true)
#5
/Users/pierre/.composer/vendor/drush/drush/commands/core/drupal/environment.inc(198):
drush_module_install(Array)
#6
/Users/pierre/.composer/vendor/drush/drush/commands/pm/pm.drush.inc(1167):
drush_module_enable(Array)
#7 [internal function]: drush_pm_enable('ds_extras')
#8
/Users/pierre/.composer/vendor/drush/drush/includes/command.inc(366):
call_user_func_array('drush_pm_enable', Array)
#9
/Users/pierre/.composer/vendor/drush/drush/includes/command.inc(217):
_drush_invoke_hooks(Array, Array)
#10 [internal function]: drush_command('ds_extras')
#11
/Users/pierre/.composer/vendor/drush/drush/includes/command.inc(185):
call_user_func_array('drush_command', Array)
#12
/Users/pierre/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#13
/Users/pierre/.composer/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#14 /Users/pierre/.composer/vendor/drush/drush/drush.php(12):
drush_main()
#15 {main}
iMac:d8-base pierre$ 
halefx’s picture

To get around this error, you just need to move (or you could just remove the file, but moving it is better) ds/modules/ds_extras/config/install/core.entity_view_mode.node.revision.yml to ds/modules/ds_extras/config/optional/core.entity_view_mode.node.revision.yml (you'll have to create the "optional" directory).

Going forward, core.entity_view_mode.node.revision.yml should probably be changed from

dependencies:
  module:
    - node
    - ds_extras

to

dependencies:
  enforced:
    module:
      - ds_extras
  module:
    - node

which will uninstall the configuration when ds_extras is uninstalled instead of abandoning the configuration in Drupal during uninstall. Or move it from "install" to "optional" if it should stay behind, etc.

finkenmann’s picture

Thanks halefx. #4 fixed the problem. It really happens only if i uninstall the modul and try to reinstall it again. If i install ds the first time, it works fine. So my error occured, because i had an other problem with a modul and uninstalled a lot of contributed moduls to search fot the error.

So, is this a bug, which should be fixed in the next version, or do i have to do this changes after an update of ds again?

halefx’s picture

It is a bug that needs to be fixed in a future version of DS.

Olafski’s picture

Similar case: on reinstall of DS I got the message "Configuration objects (core.entity_view_mode.node.revision, ds_extras.settings) provided by ds_extras already exist in active configuration" when I tried to enable DS Extras.

In addition to #4, I renamed ds/modules/ds_extras/config/install/ds_extras.settings.yml temporarily. After that, I was able to enable DS Extras.

jacekrszewczyk’s picture

Thank you!

cmwelding’s picture

Facing similar problem while reinstalling the module. Works fine on the first install. Uninstalled Display Suite Extras and reinstalled. Throws error on a clean Drupal installation. Its is bug!!
Error:
"Unable to install Display Suite Extras, core.entity_view_mode.node.revision already exists in active configuration."

kingfisher64’s picture

#4 works, thanks halefx

Will this be fixed in latest dev soon? Not working in latest dev

softone’s picture

Category: Support request » Bug report
Priority: Normal » Major
aspilicious’s picture

Status: Active » Needs review
FileSize
954 bytes

Can someone verify this works?
Works means:
- The module installs again
- The view mode actually exist on a fresh installation

This also needs a test.

The test should be named something like "ReinstallTest".
In the test all the DS modules should be reinstalled.
Than I'm sure we don't introduce any regressions in the future.
Playing with configuration is dangerous :)

Can someone finish this patch, would help me a lot.
Else this issue will not be committed before the end of june.

Joefry’s picture

I tried to reinstall DS_Extras after patch in #12 and got this: Unable to install Display Suite Extras, core.entity_view_mode.node.revision already exists in active configuration. Any suggestions welcome.

Added: After rereading all the comments here, I used suggestion in #4 and managed to reinstall Ds_extras

aspilicious’s picture

Joefry, the patch in 12 is the same as comment 4. Are you sur eyou applied the patch correctly?

Joefry’s picture

aspilicious, I see that looking at the patch. Seems clear it must have been some error on my application of patch.

halefx’s picture

The patch looks good to me, but it will only help people who have not already installed the DS Extras module. The Yaml code being modified by the patch is run at installation, so if the module has previously been installed, it's too late for this patch to help. Manually moving the Yaml file as described in #4 is the quickest solution for people in that situation.

halefx’s picture

RE: patching a update so that "The module installs again"...

There has been a lot of core discussion around finding a way to reload/refresh configuration changes in modules, but I haven't followed the progress of that enough to know if a solution has been reached.

halefx’s picture

This can probably be accomplished using a module update function if anyone here has time to look into it. See https://drupal.stackexchange.com/questions/164713/how-do-i-update-the-configuration-of-a-module for an example.

aspilicious’s picture

The patch looks good to me, but it will only help people who have not already installed the DS Extras module. The Yaml code being modified by the patch is run at installation, so if the module has previously been installed, it's too late for this patch to help

Please *test* the patch before commenting.
The patch MOVES the file so it should work as it is exactly what 4 does.
If someone can verify this I can commit this so this discussion is over. :)

More explanation:
If I'm correct the uninstall works fine, it is the installation that is broken.
When you apply the patch and uninstall, the display doesn't get deleted.
When installing again it won't fatal because the file is moved to optional.

  • aspilicious committed 47f031d on 8.x-2.x
    Issue #2670594 by aspilicious: Unable to install Display Suite Extras,...
aspilicious’s picture

Status: Needs review » Fixed

I tested this patch myself again and committed it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.