- 🇺🇸United States bsnodgrass
@ https://www.drupal.org/u/jakegibs617 → https://www.drupal.org/project/drupal/issues/3316271#comment-14878863 🐛 Config import fails with non existent theme reporting TypeError: array_diff(): Needs work appears to be the same error, but occurring on a different line.
https://www.drupal.org/project/drupal/issues/3316271#comment-14878863 🐛 Config import fails with non existent theme reporting TypeError: array_diff(): Needs work is a different issue.
The error is ambiguous and is difficult to track down. If I recall we looked at the code to determine what was actually failing and noticed old artifacts in config left over from our migration work moving from Drupal 6 to Drupal 8.
- Status changed to Needs review
about 2 years ago 3:41pm 10 April 2023 - 🇮🇳India Ranjit1032002
Created a patch for the issue mentioned, please review.
Thank You. - Status changed to Needs work
about 2 years ago 4:38pm 10 April 2023 - 🇺🇸United States smustgrave
#11 doesn't address the proposed solution "Better error messaging would be very helpful to identify what actually failed."
Have imported views several times without issues, maybe it's a problem with the view?
This will need test case though.
- 🇨🇴Colombia alejo-moreno
I'm getting a similar error when deploying to Acquia to one of the Dev databases. This is likely to happen in Prod in the next deploy but the detail of the error is not enough to spot the issue, which one could be the configuration failing? Even more weird that this just happens in Acquia and not in the local machine with the same database and code.
| | purge_queuer_coretags.settings | Delete | | | purge.logger_channels | Delete | | | new_relic_rpm.settings | Delete | +------------+--------------------------------------+-----------+ [warning] Undefined array key "theme" ConfigImporter.php:456 [error] TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given in array_diff_key() (line 456 of /mnt/www/html/project_ucod/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php) #0 /mnt/www/html/project_ucod/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(456): array_diff_key() #1 /mnt/www/html/project_ucod/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(777): Drupal\Core\Config\ConfigImporter->createExtensionChangelist() #2 /mnt/www/html/project_ucod/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(566): Drupal\Core\Config\ConfigImporter->validate() #3 /mnt/www/html/project_ucod/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(296): Drupal\Core\Config\ConfigImporter->initialize() #4 [internal function]: Drush\Drupal\Commands\config\ConfigImportCommands->doImport() #5 /mnt/www/html/project_ucod/vendor/drush/drush/includes/drush.inc(122): call_user_func_array() #6 /mnt/www/html/project_ucod/vendor/drush/drush/includes/drush.inc(113): drush_call_user_func_array() #7 /mnt/www/html/project_ucod/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(271): drush_op() #8 [internal function]: Drush\Drupal\Commands\config\ConfigImportCommands->import() #9 /mnt/www/html/project_ucod/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array() #10 /mnt/www/html/project_ucod/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() #11 /mnt/www/html/project_ucod/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() #12 /mnt/www/html/project_ucod/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process() #13 /mnt/www/html/project_ucod/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute() #14 /mnt/www/html/project_ucod/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run() #15 /mnt/www/html/project_ucod/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand() #16 /mnt/www/html/project_ucod/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun() #17 /mnt/www/html/project_ucod/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run() #18 /mnt/www/html/project_ucod/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun() #19 /mnt/www/html/project_ucod/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run() #20 /mnt/www/html/project_ucod/vendor/drush/drush/drush(4): require('...') #21 /mnt/www/html/project_ucod/vendor/bin/drush(119): include('...')
- 🇬🇧United Kingdom darren.fisher
I resolved this by looking at: web/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php
After line 289:
$data = $config_importer->getStorageComparer()->getSourceStorage()->read($name);
Put a var_dump:
var_dump($data);
This allowed me to search for instances of NULL and I found one in views.view.taxonomy_term.yml where I had:
dependencies: - config: null
Removing the
- config: null
line fixed my import issues.THIS IS NOT A ONE FIX FITS ALL SITUATION!
You need to find exactly where in your config there is an instance of NULL that shouldn't be there and get rid of it!!
Good luck. Hope this helps!
- 🇬🇧United Kingdom darren.fisher
Alternatively you could find offending item (in my case the taxonomy term view) and edit it in the UI and then save it to see if the system can resolve the config on its own and then export that item and reimport. This is what fixed it for me!
- 🇬🇧United Kingdom darren.fisher
In terms of moving this issue on it might be helpful to create a branch from this issue and have Drupal log which config file contains the offending NULL instance so that it's easier to pinpoint where the error is occurring?