All config removed after each export + TypeError

Created on 25 April 2018, over 6 years ago
Updated 4 January 2024, 11 months ago

Hi,

I was having some issues recent days whenever I exported and imported my config on a project. My colleagues were not having the same problem. Somehow this was an isolated issue.

When I exported my config all my unchanged config was removed from the system and the new or changed config was exported. After export (and after import as well) I always get the same error:

TypeError: Argument 2 passed to Drupal\config_filter\Config\FilteredStorage::write() must be of the type array, boolean given, called in /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php on line 469 in Drupal\config_filter\Config\FilteredStorage->write() (line 94 of /www/web/modules/contrib/config_filter/src/Config/FilteredStorage.php) 

#0 /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php(469): Drupal\config_filter\Config\FilteredStorage->write('language.negoti...', false)
#1 /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php(141): Drush\Drupal\Commands\config\ConfigCommands::copyConfig(Object(Drupal\Core\Config\CachedStorage), Object(Drupal\config_filter\Config\FilteredStorage))
#2 /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php(91): Drush\Drupal\Commands\config\ConfigExportCommands->doExport(Array, '../config/sync-...')
#3 [internal function]: Drush\Drupal\Commands\config\ConfigExportCommands->export('sync', Array)
#4 /www/vendor/consolidation/annotated-command/src/CommandProcessor.php(235): call_user_func_array(Array, Array)
#5 /www/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /www/vendor/consolidation/annotated-command/src/CommandProcessor.php(150): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#7 /www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 /www/vendor/symfony/console/Command/Command.php(252): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /www/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /www/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /www/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /www/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /www/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#14 /www/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#15 /www/vendor/drush/drush/drush(4): require('/Users/mdaime/W...')
#16 {main}. 

TypeError: Argument 2 passed to Drupal\config_filter\Config\FilteredStorage::write() must be of the type array, boolean given, called in /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php on line 469 in /www/web/modules/contrib/config_filter/src/Config/FilteredStorage.php on line 94 

#0 /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php(469): Drupal\config_filter\Config\FilteredStorage->write('language.negoti...', false)
#1 /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php(141): Drush\Drupal\Commands\config\ConfigCommands::copyConfig(Object(Drupal\Core\Config\CachedStorage), Object(Drupal\config_filter\Config\FilteredStorage))
#2 /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigExportCommands.php(91): Drush\Drupal\Commands\config\ConfigExportCommands->doExport(Array, '../config/sync-...')
#3 [internal function]: Drush\Drupal\Commands\config\ConfigExportCommands->export('sync', Array)
#4 /www/vendor/consolidation/annotated-command/src/CommandProcessor.php(235): call_user_func_array(Array, Array)
#5 /www/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /www/vendor/consolidation/annotated-command/src/CommandProcessor.php(150): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#7 /www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 /www/vendor/symfony/console/Command/Command.php(252): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /www/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /www/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /www/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /www/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /www/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#14 /www/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#15 /www/vendor/drush/drush/drush(4): require('/Users/mdaime/W...')
#16 {main}

TypeError: Argument 2 passed to Drupal\config_filter\Config\FilteredStorage::write() must be of the type array, boolean given, called in /www/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php on line 469 in Drupal\config_filter\Config\FilteredStorage->write() (line 94 of /www/web/modules/contrib/config_filter/src/Config/FilteredStorage.php).

Luckily we are using git so in most cases I could easily restore my config but yesterday I resetted more in Git than I wanted to (almost losing a lot of hours of work) so I had to fix this once and for all.

I noticed in the error drush tripped somewhere on my config setting for language.negotiation which is ignored on our project.
What was also different between my setup and the setup of my colleagues was that this config item was marked "create" on the ignore list of my setup and "update" on those of my colleagues.

What finally fixed my problem was to remove language.negotiation from the ignore list and my config_ignore.settings.yml, import everything, put the ignore rule via the UI back and do a last export.

At last no more errors.

I'm not sure what I've done differently or what could have caused these errors. At the least, maybe this can help others who find themselves in a similar situation.

🐛 Bug report
Status

Closed: outdated

Version

2.1

Component

Code

Created by

🇧🇪Belgium aimevp Belgium

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.

Production build 0.71.5 2024