UnexpectedTypeException when using migration lookup config

Created on 14 February 2024, 4 months ago
Updated 5 April 2024, 3 months ago

When using yaml config to define migration in custom module that has dependency on migration plus and also does a migrate lookup, this seems to trigger fatal error saying that it:

Expected argument of type "array", "null" given in

e.g. this is typical of the error thrown here.

The website encountered an unexpected error. Try again later.

Symfony\Component\Validator\Exception\UnexpectedTypeException: Expected argument of type "array", "null" given in Drupal\Core\Validation\Plugin\Validation\Constraint\ValidKeysConstraintValidator->validate() (line 23 of core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ValidKeysConstraintValidator.php).
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints(NULL, '000000000000079a0000000000000000', Array) (Line: 154)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object) (Line: 164)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object, Array, 1) (Line: 106)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object, NULL, NULL) (Line: 93)
Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object) (Line: 132)
Drupal\Core\TypedData\TypedData->validate() (Line: 352)
Drupal\config_inspector\ConfigInspectorManager->validateValues('migrate_plus.migration.rss_flickr_picture') (Line: 176

I am not sure if it is coincidence, but I have had the same with a separate migration that is used by a parent migration lookup.

This can be bypassed by disabling the custom migration from module uninstall.

I also note that the synfony/validator seems to be updated from 6.3 to 6.4 in 10.2 but I cant see any there thing there that could cause this?

Am I right in thinking it is acceptable to set key value to be null on some occasions?

Looks similar to error with search api solr here

https://www.drupal.org/project/search_api_solr/issues/3415861 πŸ› ValidKeysConstraintValidator thrown by config inspector Active

Also mentioned on config_inspector issue queue.

https://www.drupal.org/project/config_inspector/issues/3416934 πŸ› Config inspector stopped working after Drupal 10.2 update Active

Is there a Drupal issue for this already?

πŸ› Bug report
Status

Needs review

Version

6.0

Component

Plugins

Created by

πŸ‡¬πŸ‡§United Kingdom 2dareis2do

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

Comments & Activities

Production build 0.69.0 2024