Config validation error does not provide enough information when required module is missing

Created on 21 November 2023, about 1 year ago

Problem/Motivation

The configuration validation does not provide enough information to debug the following error

 [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.

 in Drupal\Core\Config\ConfigImporter->validate() (line 814 of /var/www/html/web/core/lib/Drupal/Core/Config/ConfigImporter.php). 

In ConfigImportCommands.php line 324:
                                                   
  The import failed due to the following reasons:  

We encountered this issue when we had removed the CKEditor 4 module from core.extension.yml but there was two modules remaining Fake objects and Anchor link which had a requirement for CKEditor 4.

We debugged the issue in Config validator and it seems like it's passing a large object with the requiring modules which the validator is not able to process.

Note! This only happens if you manually edit core.extension.yml and remove a module. Drupal handles the situation correctly when uninstalling the module with Drush or through UI but the Config validator should still be able to give the proper information because it's available.

Steps to reproduce

1. Install CKEditor 4, Fake objects and Anchor link modules.
2. Remove CKEditor 4 from core.extension.yml.
3. Try to run drush cim to uninstall CKEditor. This fails because the module is still required but the validation gives too little information.

Proposed resolution

Add more prepcocessing for the validation message to be able to print it in the validation message.

Added a screenshot of the validation error when printed through var_dump() to show the information available.

Remaining tasks

TBD.

User interface changes

-

API changes

-

Data model changes

-

Release notes snippet

-

🐛 Bug report
Status

Active

Version

10.1

Component
Configuration 

Last updated about 17 hours ago

Created by

🇫🇮Finland heikkiy Oulu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024