I installed fresh opigno and unable to config import.

Steps to reproduce:
1. After fresh installation does some basic configuration changes in opigno theme settings.
2. Do config export.
3. Try to do config import (drush cim)

Getting below error;

 [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
Site UUID in source storage does not match the target storage.
Entities exist of type <em class="placeholder">Taxonomy term</em> and <em class="placeholder">Vocabulary</em> <em class="placeholder">Forums</em>. These entities need to be deleted before importing.
Configuration <em class="placeholder">block.block.privatemessageactions</em> depends on the <em class="placeholder">Bartik</em> theme that will not be installed after import.
Configuration <em class="placeholder">block.block.privatemessageinbox</em> depends on the <em class="placeholder">Bartik</em> theme that will not be installed after import.
Configuration <em class="placeholder">block.block.privatemessagenotification</em> depends on the <em class="placeholder">Bartik</em> theme that will not be installed after import.
Configuration <em class="placeholder">field.field.media.image_png.field_media_image</em> depends on the <em class="placeholder">Content Translation</em> module that will not be installed after import.
Configuration <em class="placeholder">search.page.node_search</em> depends on the <em class="placeholder">Search</em> module that will not be installed after import.
Configuration <em class="placeholder">search.page.user_search</em> depends on the <em class="placeholder">Search</em> module that will not be installed after import. in Drupal\Core\Config\ConfigImporter->validate() (line 755 of /var/www/html/core/lib/Drupal/Core/Config/ConfigImporter.php).

In ConfigImportCommands.php line 343:

  The import failed due to the following reasons:
  Site UUID in source storage does not match the target storage.
  Entities exist of type <em class="placeholder">Taxonomy term</em> and <em class="placeholder">Vocabulary</em> <em class="placeholder">Forums</em>. These entities need to be deleted before importing.
  Configuration <em class="placeholder">block.block.privatemessageactions</em> depends on the <em class="placeholder">Bartik</em> theme that will not be installed after import.
  Configuration <em class="placeholder">block.block.privatemessageinbox</em> depends on the <em class="placeholder">Bartik</em> theme that will not be installed after import.
  Configuration <em class="placeholder">block.block.privatemessagenotification</em> depends on the <em class="placeholder">Bartik</em> theme that will not be installed after import.
  Configuration <em class="placeholder">field.field.media.image_png.field_media_image</em> depends on the <em class="placeholder">Content Translation</em> module that will not be installed after import
  .
  Configuration <em class="placeholder">search.page.node_search</em> depends on the <em class="placeholder">Search</em> module that will not be installed after import.
  Configuration <em class="placeholder">search.page.user_search</em> depends on the <em class="placeholder">Search</em> module that will not be installed after import.

This should not be the case in distribution.
If this will give error on dev activist one cannot add the deployment process with this and can't modify the system also.

Comments

sharma.amitt16 created an issue. See original summary.

sharma.amitt16’s picture

Issue summary: View changes
sharma.amitt16’s picture

Status: Active » Needs review

I fix the problem locally by doing below.

The dependency of Bartik Theme in the below files.

Bartik theme is not enabled but dependency is added in custom config : 
/profiles/opigno_lms/modules/contrib/private_message/config/install/block.block.privatemessageactions.yml
/profiles/opigno_lms/modules/opigno/opigno_course/config/optional/field.field.media.image_png.field_media_image.yml
/profiles/opigno_lms/config/optional/block.block.privatemessageinbox.yml

Content translation module is disabled but dependency is added.

profiles/opigno_lms/modules/opigno/opigno_course/config/optional/field.field.media.image_png.field_media_image.yml

Solution:
1. Enabled the module content_translation
2. Export configuration.
3. Disabled the module again.
4. Export configuration. It removes the dependency of content_translation in the above field file. I can do it manually but I want to be double sure so I did enable/disable to do it automatically by the system.

Dependency on search plugin while it is not enabled:

/profiles/opigno_lms/modules/opigno/opigno_search/config/rewrite/search.page.node_search.yml
/profiles/opigno_lms/modules/opigno/opigno_search/config/rewrite/search.page.user_search.yml

Solution: Same as above. Enabled and disabled the module. It removes the node and user search YML files created by the search module which must be deleted in default opigno profile configuration if we are not using this.

axelm’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hi @sharma.amitt16
We cannot reproduce this issue, this works for a fresh installation

sharma.amitt16’s picture

It works fine there is no error on a fresh installation.
The issue comes when after successful installation When I did drush cex to push my configuration in the config directory and then import.

axelm’s picture

Hi @sharma.amitt16
This is exactly what we did when trying to reproduce, but no error

somersoft’s picture

Just a quick comment to point people to the patches for this issue as they are under their own packages.

alex.bukach’s picture

A workaround actually is to remove that dependencies from the exported configuration manually.

claudiu.cristea’s picture

Status: Postponed (maintainer needs more info) » Needs work

I was able to reproduce all issues:

axelm’s picture

Hi everybody,
We will apply in the next Opigno release patches as mentioned in the related issues mentioned by @claudiu.cristea

axelm’s picture

Status: Needs work » Patch (to be ported)
axelm’s picture

Status: Patch (to be ported) » Fixed

Released in Opigno 2.23

axelm’s picture

Status: Fixed » Closed (fixed)
bailey86’s picture

Hi,

If using the search_api module it recommends that the search module is removed - however - the opigno_search module still has the dependencies on the search module - and on search_api:

name: Opigno Search
type: module
description: Opigno Search based on Search API.
core: 8.x
package: Opigno
dependencies:
  - drupal:search
  - search_api:search_api
  - search_api:search_api_db
  - config_rewrite

# Information added by Drupal.org packaging script on 2021-06-03
version: '8.x-1.7'
project: 'opigno_search'
datestamp: 1622718405

Could the search module be removed from here as well please?

electrokate’s picture

This is still an issue in 3.0.0. Fresh install on empty database, then import config and get this:

Entities exist of type <em class="placeholder">Taxonomy term</em> and <em class="placeholder">Vocabulary</em> <em class="placeholder">Forums</em>. These entities need to be deleted before importing.

maciej.jakubowski’s picture

Make sure module is turned on in config files as well it should be listed as:
'search: 0'
in core.extensions.yml file. Otherwise drupal will try to uninstall it which results in this error:
depends on the <em class="placeholder">Search</em> module that will not be installed after import.