Problem/Motivation

The deployment script I'm uses symlinks of the core.extension.yml file from the related environment directory. I was unintentionally missing the file in my staging configs and it gave me this cryptic message:

// I've changed the directories and the drush command for privacy.
drush config-import core --partial --cache-clear=0
TypeError: Argument 2 passed to Drupal\config\StorageReplaceDataWrapper::replaceData() must be of the type array, boolean given, called in                                                                                        [error]
drush/drush/commands/core/config.drush.inc on line 619 in Drupal\config\StorageReplaceDataWrapper->replaceData() (line 198 of
web/core/modules/config/src/StorageReplaceDataWrapper.php) #0 vendor/drush/drush/commands/core/config.drush.inc(619):
Drupal\config\StorageReplaceDataWrapper->replaceData('core.extension', false)
#1 vendor/drush/drush/includes/command.inc(422): drush_config_import('core')
#2 vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#3 vendor/drush/drush/includes/command.inc(199): drush_command('core')
#4 vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#5 vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#6 vendor/drush/drush/drush.php(12): drush_main()
#7 {main}.
TypeError: Argument 2 passed to Drupal\config\StorageReplaceDataWrapper::replaceData() must be of the type array, boolean given, called in vendor/drush/drush/commands/core/config.drush.inc on line 619 in web/core/modules/config/src/StorageReplaceDataWrapper.php on line 198 #0 vendor/drush/drush/commands/core/config.drush.inc(619): Drupal\config\StorageReplaceDataWrapper->replaceData('core.extension', false)
#1 vendor/drush/drush/includes/command.inc(422): drush_config_import('core')
#2 vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#3 vendor/drush/drush/includes/command.inc(199): drush_command('core')
#4 vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#5 vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#6 vendor/drush/drush/drush.php(12): drush_main()
#7 {main}
TypeError: Argument 2 passed to Drupal\config\StorageReplaceDataWrapper::replaceData() must be of the type array, boolean given, called in vendor/drush/drush/commands/core/config.drush.inc on line 619 in Drupal\config\StorageReplaceDataWrapper->replaceData() (line 198 of web/core/modules/config/src/StorageReplaceDataWrapper.php).
Drush command terminated abnormally due to an unrecoverable error.

Another problem is that this causes the config page to give a white screen.

It would be nice if the feedback was more descriptive like 'Your core.extension.yml file is missing'.

Steps to reproduce, just delete your core.extension.yml and try to import.

Comments

japo32 created an issue. See original summary.

cilefen’s picture

Have you tried this with the core UI? ConfigImportSubscriber seems to check for this very thing.

japo32’s picture

@cilefen, Do you mean using /admin/config/development/configuration? When I go there it just gives me a white screen.

cilefen’s picture

Oh. What is logged with the WSOD?

japo32’s picture

It's another type error. Here's the error:

TypeError: Argument 1 passed to Drupal\field\ConfigImporterFieldPurger::getFieldStoragesToPurge() must be of the type array, boolean given, called in /var/www/web/core/modules/field/field.module on line 334 in Drupal\field\ConfigImporterFieldPurger::getFieldStoragesToPurge() (line 111 of /var/www/web/core/modules/field/src/ConfigImporterFieldPurger.php)
#0 /var/www/web/core/modules/field/field.module(334): Drupal\field\ConfigImporterFieldPurger::getFieldStoragesToPurge(false, Array) 
#1 /var/www/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(501): field_form_config_admin_import_form_alter(Array, Object(Drupal\Core\Form\FormState), 'config_admin_im...') 
#2 /var/www/web/core/lib/Drupal/Core/Form/FormBuilder.php(819): Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object(Drupal\Core\Form\FormState), 'config_admin_im...') 
#3 /var/www/web/core/lib/Drupal/Core/Form/FormBuilder.php(272): Drupal\Core\Form\FormBuilder->prepareForm('config_admin_im...', Array, Object(Drupal\Core\Form\FormState)) 
#4 /var/www/web/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm('config_admin_im...', Object(Drupal\Core\Form\FormState)) 
#5 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) 
#6 /var/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) 
#7 /var/www/web/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
#8 /var/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) 
#9 /var/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) 
#10 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() 
#11 /var/www/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Object(Closure), Array) 
#12 /var/www/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) 
#13 /var/www/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#14 /var/www/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#15 /var/www/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#16 /var/www/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#17 /var/www/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#18 /var/www/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#19 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#20 /var/www/web/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#21 /var/www/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) 
#22 {main}.
mradcliffe’s picture

Version: 8.3.7 » 8.4.x-dev

I reproduced this in 8.4.4 when I started using a configuration directory with partial exports because there are things that I don't necessarily want to export. It looks like core.extension.yml is a required config, but I'm not sure if that's documented.

I don't plan on using the config synchronization functionality in the UI - only the export UI for development.

kapil17’s picture

@japo32 This can be reproduced when you remove your core.extension.yml from your config path. I guess your core.extension.yml is not present at the path defined in your local settings file. please check because in my multi site setup the core.extension was not there and it was creating the same issue and it is fixed when i placed that file in the path defined in local.settings.php.

Version: 8.4.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

thomaswalther’s picture

I do not know how to solve this.

If I open /admin/config/development/configuration I got this error:

[31-Jan-2021 13:45:58 Europe/Berlin] TypeError: Argument 1 passed to Drupal\field\ConfigImporterFieldPurger::getFieldStoragesToPurge() must be of the type array, bool given, called in /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/modules/field/field.module on line 323 in /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/modules/field/src/ConfigImporterFieldPurger.php on line 111 #0 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/modules/field/field.module(323): Drupal\field\ConfigImporterFieldPurger::getFieldStoragesToPurge(false, Array)
#1 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(539): field_form_config_admin_import_form_alter(Array, Object(Drupal\Core\Form\FormState), 'config_admin_im...')
#2 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/Form/FormBuilder.php(836): Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object(Drupal\Core\Form\FormState), 'config_admin_im...')
#3 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/Form/FormBuilder.php(279): Drupal\Core\Form\FormBuilder->prepareForm('config_admin_im...', Array, Object(Drupal\Core\Form\FormState))
#4 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\config\Form\ConfigSync), Object(Drupal\Core\Form\FormState))
#5 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#6 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#7 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#8 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#9 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#10 /Applications/MAMP/htdocs/drushproject/drupal8.dev/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /Applications/MAMP/htdocs/drushproject/drupal8.dev/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#12 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /Applications/MAMP/htdocs/drushproject/drupal8.dev/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /Applications/MAMP/htdocs/drushproject/drupal8.dev/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#21 {main}

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.