Respect the submission guidelines above! Drupal.org issue forks cause additional work for the project maintainer!
Setup
- Solr version: n/a
- Drupal Core version: 10.2
- Search API version:n/a
- Search API Solr version: 4.3.2
- Configured Solr Connector: n/a
Issue
Install this module
Install config inspector
View the report at: /admin/reports/config-inspector
Error thrown on search_api_solr.solr_cache.*:solr_configs because it is null and the validator is expecting an empty array.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screenshot 2024-03-08 at 17.45.54.png | 248.48 KB | 2dareis2do |
Comments
Comment #2
heddnI think is comes from all of the
nullable: truestuff all over the config schema in this module. There is a lot of it though, so I wonder if something in core should be handling this differently.Comment #3
wim leersDoes this happen only when using https://www.drupal.org/project/config_inspector's UI?
Comment #4
heddnAutomated testing in the CI where we essentially do
protected $strictConfigSchema = TRUEdoes not trigger any exceptions. Runningdrush config:inspect --only-errorand the web UI trigger the same exception logic.Comment #5
wim leersThanks for the fast response! 👍
Excellent, that means no production sites are impacted 👍
That's because I changed
\Drupal\config_inspector\ConfigInspectorManager::validateValues()(I'm a co-maintainer of Config Inspector now) in #3359418: Expose validation constraint violations in Config Inspector UI and drush command to execute validation constraints.You should be able to reproduce this ever since #3092298: Solr Caches should be managed via Drupal's config management happened, with the most recent version of Config Inspector, on all versions of Drupal core.
Could you please try this on Drupal 10.1 or 10.0? 🙏 That'd confirm my hypothesis 😊
Comment #6
heddnWhat version of config inspector? The most recent? None of my sites are still using 10.0/10.1 any more but when were still using it, we didn't have issues. It was only recently this started.
Comment #7
wim leersWhat is the exact validation error message, by which validation constraint does it get generated?
Comment #8
heddnLine 22-24 is what is triggered. Solr has those values as
null. But the validator thinks they should be an empty array.Comment #9
2dareis2do commentedThanks @heddin. I am having similar issue with custom migrate script using custom module with migrate_plus dependency and migration lookup config?
Created a new issue here:
https://www.drupal.org/project/migrate_plus/issues/3421445
Comment #10
2dareis2do commentedIs there a core issue for this?
Comment #11
2dareis2do commentedI was able to add the following to circumvent fatal error on migrate lookup config
Comment #12
2dareis2do commentedThis is the error I am seeing:
This can be reproduced by going to /admin/reports/config-inspector/search_api_solr.solr_cache.cache_document_default_7_0_0/list
Comment #13
2dareis2do commentedFrom /admin/config/search/search-api/server/streathamlife/solr_cache
We have the following (see attached)
namely
The following config schema work ok:
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_filter_default_7_0_0/list
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_queryresult_default_7_0_0/list
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_fieldvalue_default_7_0_0/list
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_filter_default_9_0_0/list
These ones don't
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_document_default_7_0_0/list
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_persegfilter_default_7_0_0/list
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_document_default_9_0_0/list
/admin/reports/config-inspector/search_api_solr.solr_cache.cache_persegfilter_default_9_0_0/list
see full error stack/log dump above.
Comment #14
2dareis2do commentedworking:
Not working
Comment #15
2dareis2do commentedIssue fixed with this patch here
https://www.drupal.org/project/drupal/issues/3364109
Comment #16
wim leers#15: what does that mean, that #3364109 fixed "the issue"? #3364109: Configuration schema & required values: add test coverage for `nullable: true` validation support was committed to Drupal 10.3 and 11 on December 15 … and I guess I'm answering my own question: it sounds like this happens on Drupal 10.2, which doesn't have that addition.
I'm currently investigating #3359418: Expose validation constraint violations in Config Inspector UI and drush command, which should make Config Inspector work not crash on any config (even invalid config or config with invalid schema — note I'm not sure yet that is actually the case here, but I'm just stating that Config Inspector should always work and not crash 😊 — otherwise it's a bug in Config Inspector).
Comment #17
wim leers#16: found the answer: #3416934-23: Config Inspector crashes on 10.1.x + 10.2.x for `type: mapping` with `nullable: true` due to core bug.
Work-around committed. In Drupal 10.3 and newer that work-around won't be necessary anymore 👍
Comment #18
2dareis2do commentedThank you
That confused me for a while. The problem was the breaking change in config inspector afaict
Comment #19
mkalkbrennerThank you!