Incorrect errors when there is no schema

Created on 18 June 2024, 3 months ago
Updated 19 September 2024, 9 days ago

Problem/Motivation

If some config has no schema and you use the options --only-error --detail on the drush command you get errors like:

 ---------------------------------------------------------------------------------------------------------------------------------- ---------------- ------------- ----------
  Key                                                                                                                                Status           Validatable   Data
 ---------------------------------------------------------------------------------------------------------------------------------- ---------------- ------------- ----------
  anchor_navigation.settings                                                                                                         No schema
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort                                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort._core                                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort._core.default_config_hash                                     No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.backend                                                       No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.backend_configuration                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.backend_configuration.lease_time                              No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies                                                  No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies.enforced                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies.enforced.module                                  No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.dependencies.enforced.module.0                                No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.id                                                            No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.label                                                         No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.langcode                                                      No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.locked                                                        No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.processing_time                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.processor                                                     No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.status                                                        No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold                                                     No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold.limit                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold.state                                               No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.threshold.type                                                No schema        NOT           ✅❓
   anchor_navigation.settings:advancedqueue.advancedqueue_queue.vgwort.uuid                                                          No schema        NOT           ✅❓

It's because it is incorrectly using the property paths from the previous config object it examined.

Steps to reproduce

Run drush config:inspect --only-error --detail when there is config with no schema and there is config with a schema earlier in the loop.

Proposed resolution

Initialise variable in the correct place.

Remaining tasks

User interface changes

Less incorrect info in output.

API changes

None

Data model changes

None

🐛 Bug report
Status

RTBC

Version

2.1

Component

Code

Created by

🇬🇧United Kingdom alexpott 🇪🇺🌍

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

Merge Requests

Comments & Activities

  • Issue created by @alexpott
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍
  • Status changed to Needs review 3 months ago
  • Pipeline finished with Manual
    3 months ago
    #202102
  • Status changed to RTBC 3 months ago
  • 🇩🇪Germany daniel.bosen

    I have lots of these errors in my projects. The patch fixes it and the implementation looks good to me.

  • 🇧🇪Belgium herved

    I stumbled on this issue in our CI, but cannot reproduce locally for some reason...

    The patch does fix the issue for me as well, as long as I don't use --list-constraints
    If I do, I get:

    /vendor/bin/drush config:inspect --only-error --detail --list-constraints
    >  🤖 Analyzing…
    
     [warning] Undefined array key "menu_position.settings" ConfigSchemaValidatability.php:164
    TypeError: Drupal\config_inspector\ConfigSchemaValidatability::getConstraints(): Return value must be of type array, null returned in modules/contrib/config_inspector/src/ConfigSchemaValidatability.php on line 164 #0 modules/contrib/config_inspector/src/Commands/InspectorCommands.php(577): Drupal\config_inspector\ConfigSchemaValidatability->getConstraints()
    #1 modules/contrib/config_inspector/src/Commands/InspectorCommands.php(257): Drupal\config_inspector\Commands\InspectorCommands::getPrintableConstraints()
    #2 [internal function]: Drupal\config_inspector\Commands\InspectorCommands->inspect()
    

    This might be another issue I'm not sure...

Production build 0.71.5 2024