TypeError: Argument 2 must be of the type array, bool given

Created on 10 April 2020, about 4 years ago
Updated 13 February 2024, 5 months ago

Problem/Motivation

I'm still getting whitescreens when there's a seeming mismatch between what configs exist in the database, what configs exist in my codebase, and what configs are in my config_ignore list.

(I think #2972302: Offset error within IgnoreFilter::activeReadMultiple() helped, but I'm on module version 8.x-2.2 and still having problems, and the other "typeerror" issues I'm finding seem to be related to when config gets exported, AND I think they're all for version 3.x...)

Ok so, to reproduce on demand, here's what worked for me:

  1. In config_ignore, I have devel.settings:rebuild_theme on one of the lines.
  2. I uninstall devel module -- I thought this would cause the whitescreen, but I was wrong -- when I go to admin/config/development/configuration, everything works as it should.
  3. I change my config_ignore settings to remove ":rebuild_theme" -- so now it's just devel.settings. (Devel module still uninstalled.)
  4. Now, I get a whitescreen on admin/config/development/configuration

Details from watchdog -- type: php, severity: error:

TypeError: Argument 2 passed to Drupal\Core\Config\DatabaseStorage::write() must be of the type array, bool given, called in /path/to/web/core/lib/Drupal/Core/Config/StorageCopyTrait.php on line 33 in Drupal\Core\Config\DatabaseStorage->write() (line 120 of /path/to/web/core/lib/Drupal/Core/Config/DatabaseStorage.php)

#0 /path/to/web/core/lib/Drupal/Core/Config/StorageCopyTrait.php(33): Drupal\Core\Config\DatabaseStorage->write('devel.settings', false)
#1 /path/to/web/core/lib/Drupal/Core/Config/ImportStorageTransformer.php(117): Drupal\Core\Config\ImportStorageTransformer::replaceStorageContents(Object(Drupal\config_filter\Config\FilteredStorage), Object(Drupal\Core\Config\DatabaseStorage))
#2 /path/to/web/core/modules/config/src/Form/ConfigSync.php(210): Drupal\Core\Config\ImportStorageTransformer->transform(Object(Drupal\config_filter\Config\FilteredStorage))
#3 [internal function]: Drupal\config\Form\ConfigSync->buildForm(Array, Object(Drupal\Core\Form\FormState))
#4 /path/to/web/core/lib/Drupal/Core/Form/FormBuilder.php(520): call_user_func_array(Array, Array)
#5 /path/to/web/core/lib/Drupal/Core/Form/FormBuilder.php(277): Drupal\Core\Form\FormBuilder->retrieveForm('config_admin_im...', Object(Drupal\Core\Form\FormState))
#6 /path/to/web/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\config\Form\ConfigSync), Object(Drupal\Core\Form\FormState))
#7 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#8 /path/to/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#9 /path/to/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /path/to/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#11 /path/to/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#12 /path/to/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /path/to/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#14 /path/to/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /path/to/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /path/to/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /path/to/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /path/to/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /path/to/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /path/to/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /path/to/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /path/to/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#23 {main}

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Original report by [username]

🐛 Bug report
Status

Closed: outdated

Version

3.2

Component

Code

Created by

🇺🇸United States alison

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇭Switzerland bircher 🇨🇿

    This issue is being closed because Config Ignore 2.x is deprecated.

    The new 3,x version has been re-written from the ground up and works in a totally different way, yet it provides the same backwards compatible functionality. All the 2.x tests pass in 3.x and the 3.x codebase is easier to maintain.
    Users of 2.x are strongly encouraged to upgrade to 3.x, as there is a very simple update path.

    So likely this issue is no longer relevant. If you think that this issue still applies please open it again and target the new branch. All issues on the 2.x branch were closed in bulk.

  • Status changed to Active 5 months ago
  • 🇷🇪Réunion Martygraphie Saint-Denis (Réunion)

    Hi,
    I am reopening this issue, I reproduce the same error on the ^3.2 version of config ignore. With steps similar to those described initially.

    Drupal version: 10.1
    Drush version: 11

    I also tried with and without config_filter (lats version)

  • Status changed to Closed: outdated 5 months ago
  • 🇷🇪Réunion Martygraphie Saint-Denis (Réunion)

    Apologise, this was caused by an external script that doesn't belong to config ignore, so I'm closing the exit.

Production build 0.69.0 2024