Error on config export

Created on 5 March 2025, 5 months ago

Problem/Motivation

Steps to reproduce

simple "drush cex -y"

output:
[error] TypeError: Drupal\config_split\ConfigSplitManager::inFilterList(): Argument #2 ($list) must be of type array, null given, called in /var/www/project/docroot/modules/contrib/config_split/src/ConfigSplitManager.php on line 371 in Drupal\config_split\ConfigSplitManager::inFilterList() (line 958 of /var/www/project/docroot/modules/contrib/config_split/src/ConfigSplitManager.php) #0 /var/www/project/docroot/modules/contrib/config_split/src/ConfigSplitManager.php(371): Drupal\config_split\ConfigSplitManager::inFilterList('system.menu.dev...', NULL)
#1 [internal function]: Drupal\config_split\ConfigSplitManager->{closure:Drupal\config_split\ConfigSplitManager::splitPreview():369}('system.menu.dev...')
#2 /var/www/project/docroot/modules/contrib/config_split/src/ConfigSplitManager.php(369): array_filter(Array, Object(Closure))
#3 /var/www/project/docroot/modules/contrib/config_split/src/ConfigSplitManager.php(235): Drupal\config_split\ConfigSplitManager->splitPreview(Object(Drupal\Core\Config\ImmutableConfig), Object(Drupal\Core\Config\DatabaseStorage), Object(Drupal\Core\Config\DatabaseStorage))
#4 /var/www/project/docroot/modules/contrib/config_split/src/EventSubscriber/SplitImportExportSubscriber.php(82): Drupal\config_split\ConfigSplitManager->exportTransform('local', Object(Drupal\Core\Config\StorageTransformEvent))
#5 [internal function]: Drupal\config_split\EventSubscriber\SplitImportExportSubscriber->exportDefaultPriority(Object(Drupal\Core\Config\StorageTransformEvent), 'config.transfor...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#6 /var/www/project/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\Core\Config\StorageTransformEvent), 'config.transfor...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#7 /var/www/project/docroot/core/lib/Drupal/Core/Config/ExportStorageManager.php(88): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\Core\Config\StorageTransformEvent), 'config.transfor...')
#8 /var/www/project/docroot/core/lib/Drupal/Core/Config/ManagedStorage.php(146): Drupal\Core\Config\ExportStorageManager->getStorage()
#9 /var/www/project/docroot/core/lib/Drupal/Core/Config/ManagedStorage.php(134): Drupal\Core\Config\ManagedStorage->getStorage()
#10 /var/www/project/docroot/core/lib/Drupal/Core/Config/StorageComparer.php(111): Drupal\Core\Config\ManagedStorage->getCollectionName()
#11 /var/www/project/vendor/drush/drush/src/Commands/config/ConfigExportCommands.php(121): Drupal\Core\Config\StorageComparer->__construct(Object(Drupal\Core\Config\ManagedStorage), Object(Drupal\Core\Config\FileStorage))
#12 /var/www/project/vendor/drush/drush/src/Commands/config/ConfigExportCommands.php(100): Drush\Commands\config\ConfigExportCommands->doExport(Array, '../config/sync')
#13 [internal function]: Drush\Commands\config\ConfigExportCommands->export(Array)
#14 /var/www/project/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
#15 /var/www/project/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#16 /var/www/project/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#17 /var/www/project/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#18 /var/www/project/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/project/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/project/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/project/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/project/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/project/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/project/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run(Array)
#25 /var/www/project/vendor/bin/drush.php(119): include('/var/www/projec...')
#26 {main}.

Proposed resolution

add check to inFilterList function for permit and check empty or nullable values

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @currant.s
  • Accept empty or nullable $list and add check if it's empty

  • 🇨🇭Switzerland bircher 🇨🇿

    I am pretty sure this problem stems from the fact that your split configuration is corrupted.
    I am all in favor of more defensive coding and we should make sure that the the inputs are all good. But the method you are patching is internal and it is better if it complains when it is fed invalid data. because most probably the other code that assumes the list is an array is also broken and may hide other bugs.

Production build 0.71.5 2024