Problem/Motivation

When I try to apply database updates via drush, I'm getting following:
Unable to decode output into JSON: Syntax error

TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in ArrayObject->__construct() (l
ine 15 of /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php).

Full Dump would be:
> [error] TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in ArrayObject->__construct() (line 15 of /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php) #0 /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php(15): ArrayObject->__construct(false)
> #1 /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/UnstructuredListData.php(21): Consolidation\OutputFormatters\StructuredData\AbstractListData->__construct(false)
> #2 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(132): Consolidation\OutputFormatters\StructuredData\UnstructuredListData->__construct(false)
> #3 [internal function]: Drush\Commands\core\UpdateDBCommands->process('76', Array)
> #4 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
> #5 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #6 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #7 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #8 /var/www/html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #9 /var/www/html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #10 /var/www/html/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))
> #11 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #12 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #13 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #14 /var/www/html/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run(Array)
> #15 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
> #16 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...')
> #17 {main}.
> TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php on line 15 #0 /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php(15): ArrayObject->__construct(false)
> #1 /var/www/html/vendor/consolidation/output-formatters/src/StructuredData/UnstructuredListData.php(21): Consolidation\OutputFormatters\StructuredData\AbstractListData->__construct(false)
> #2 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(132): Consolidation\OutputFormatters\StructuredData\UnstructuredListData->__construct(false)
> #3 [internal function]: Drush\Commands\core\UpdateDBCommands->process('76', Array)
> #4 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
> #5 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #6 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #7 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #8 /var/www/html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #9 /var/www/html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #10 /var/www/html/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))
> #11 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #12 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #13 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #14 /var/www/html/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run(Array)
> #15 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
> #16 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...')
> #17 {main}

This only happens via drush updb; running update.php in browser went OK in both Cases - I've tried 12.0.9 to 12.1.0 and 12.1.0 to 12.2.0

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#8 drush-3424356-8.patch665 bytesa.milkovsky

Comments

32i created an issue. See original summary.

rolandoscott’s picture

This probably means that you are using an old version of Drush in combination with Drupal 10.2. The solution is to install at least Drush version 12.4.3.

ronaldtebrake’s picture

Status: Active » Closed (won't fix)

Seems like #2 is indeed the solution, thanks for that: also noticed it here: https://gorannikolovski.com/snippet/drupal-102-and-drush

dioni’s picture

On a fresh install, I can't install drush 12.

composer why-not drush/drush 12.4.3
drush/drush                12.4.3     requires         chi-teck/drupal-code-generator (^3.0)

But chi-teck/drupal-code-generator is blocked on ^2

composer why-not chi-teck/drupal-code-generator 3
drupal/update_helper 3.0.4       requires chi-teck/drupal-code-generator (^2.4)

And drupal/update_helper can't be updated because drupal/config_modify:

composer why-not drupal/update_helper 4
drupal/config_modify       1.1.0      requires         drupal/update_helper (^2 || ^3)  

And 'Social core' has config_modify as dependency.

I guess the only option is an update to config_modify module to support update_helper ^4

abautu’s picture

#2 worked for me.

I had exactly the same error (using drush 11). I did composer update drush/drush -W and drush updb worked after that.

bryanrice’s picture

Its happening again for Drush version 12.5.3.0

fin drush --version
Drush Commandline Tool 12.5.3.0

Drupal

Drupal version   : 10.4.3
hitchshock’s picture

Status: Closed (won't fix) » Active

Approve that it is still reproducible for drush en <module>

Drupal: 10.4.6
Drush: 12.5.3

a.milkovsky’s picture

StatusFileSize
new665 bytes

In our case it is reproducible with `drush en ` on Drupal without Open Social profile.
It looks like a general issue with either drush or Drupal.

We noticed, that drush there is a batch transaction for module translation on activation. _drush_backend_batch_process() -> $batch['id'] = $batch_storage->getId();. But it does not save a value in the database, as the transaction is not committed yet. We could not figure out the reason why.

We ended up with a patch for drush to force committing the pending transactions.

For context:
Drupal 10.4
MySql 8.0.41-1.el9, transaction_isolation=READ-COMMITED;
Drush 13.6.0.0

Might be related: https://github.com/drush-ops/drush/issues/5797

a.milkovsky’s picture

Update: in my case this issue was happening only locally. The cause is this Xdebug bug 0002322: Xdebug tries to open debugging connection in destructors during shutdown.

Solution: update Xdebug to 3.4.5.