Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in ArrayObject->__construct() #5797

Closed
alayham opened this issue Oct 27, 2023 · 3 comments

Comments

@alayham
Copy link

alayham commented Oct 27, 2023

Describe the bug

I am updating a complex site from D9.5 to D10.2 dev. I can run the db updates manually, and the site works fine, but with drush updb I get the following error after listing the available updates.

// Do you wish to run the specified pending updates?: yes.                                                             

>  [error]  TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in ArrayObject->__construct() (line 15 of /var/www/drupal/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php) #0 /var/www/drupal/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php(15): ArrayObject->__construct()
> #1 /var/www/drupal/vendor/consolidation/output-formatters/src/StructuredData/UnstructuredListData.php(21): Consolidation\OutputFormatters\StructuredData\AbstractListData->__construct()
> #2 /var/www/drupal/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(132): Consolidation\OutputFormatters\StructuredData\UnstructuredListData->__construct()
> #3 [internal function]: Drush\Commands\core\UpdateDBCommands->process()
> #4 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
> #5 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
> #6 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
> #7 /var/www/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
> #8 /var/www/drupal/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
> #9 /var/www/drupal/vendor/symfony/console/Application.php(1081): Symfony\Component\Console\Command\Command->run()
> #10 /var/www/drupal/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
> #11 /var/www/drupal/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
> #12 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
> #13 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
> #14 /var/www/drupal/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run()
> #15 /var/www/drupal/vendor/drush/drush/drush(4): require('...')
> #16 /var/www/drupal/vendor/bin/drush(120): include('...')
> #17 {main}. 
> TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in /var/www/drupal/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php on line 15 #0 /var/www/drupal/vendor/consolidation/output-formatters/src/StructuredData/AbstractListData.php(15): ArrayObject->__construct()
> #1 /var/www/drupal/vendor/consolidation/output-formatters/src/StructuredData/UnstructuredListData.php(21): Consolidation\OutputFormatters\StructuredData\AbstractListData->__construct()
> #2 /var/www/drupal/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(132): Consolidation\OutputFormatters\StructuredData\UnstructuredListData->__construct()
> #3 [internal function]: Drush\Commands\core\UpdateDBCommands->process()
> #4 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
> #5 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
> #6 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
> #7 /var/www/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
> #8 /var/www/drupal/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
> #9 /var/www/drupal/vendor/symfony/console/Application.php(1081): Symfony\Component\Console\Command\Command->run()
> #10 /var/www/drupal/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
> #11 /var/www/drupal/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
> #12 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
> #13 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
> #14 /var/www/drupal/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run()
> #15 /var/www/drupal/vendor/drush/drush/drush(4): require('...')
> #16 /var/www/drupal/vendor/bin/drush(120): include('...')
> #17 {main}
>  [warning] Drush command terminated abnormally.

In ProcessBase.php line 171:
                                                                                                                                                                                    
 Unable to decode output into JSON: Syntax error                                                                                                                                    
                                                                                                                                                                                    
 TypeError: ArrayObject::__construct(): Argument #1 ($array) must be of type array, bool given in ArrayObject->__construct() (line 15 of /var/www/drupal/vendor/consolidation/outp  
 ut-formatters/src/StructuredData/AbstractListData.php).                                                                                                                            
                                                                                                                                                                                    

Drupal version   : 10.2.0-dev                                   
Site URI         : http://default                               
DB driver        : mysql                                        
DB hostname      : localhost                                    
DB port          :                                              
DB username      : ***                                  
DB name          : ********                             
Database         : Connected                                    
Drupal bootstrap : Successful                                   
Default theme    : magic                                        
Admin theme      : claro                                        
PHP binary       : /usr/bin/php8.2                              
PHP config       : /etc/php/8.2/cli/php.ini                     
PHP OS           : Linux                                        
PHP version      : 8.2.7                                        
Drush script     : /var/www/drupal/vendor/bin/drush             
Drush version    : 11.6.0                                       
Drush temp       : /tmp                                         
Drush configs    : /var/www/drupal/vendor/drush/drush/drush.yml 
Install profile  : minimal                                      
Drupal root      : /var/www/drupal/web                          
Site path        : sites/default                                
Files, Public    : sites/default/files                          
Files, Temp      : /tmp                                         

To Reproduce
composer create_project
composer require modules
import a db dump
drush updb
drush status

Expected behavior
Run DB updates

Actual behavior
Command crashes.

Workaround
Run DB updates from the UI. Needed to enable update_free_access because I could not login. not sure if that is related.

System Configuration

Q A
Drush version? tested with 12.4 and 11.6
Drupal version? 10.2-dev
PHP version 8.2
OS? Debian, running as lxc on Proxmox

Additional information
Add any other context about the problem here.

@Berdir
Copy link
Contributor

Berdir commented Nov 10, 2023

Seeing this as well. this is just the follow-up error, there is something wrong with batch execution.

Suspiciously, the first update that's supposed to run is system_update_10101 (wrong number) from https://www.drupal.org/node/3337513, that looks very related.

@Berdir
Copy link
Contributor

Berdir commented Nov 10, 2023

I think #5509 was meant to fix it, but this was also reported for drush 12.4, investigating that now, I was still on 11.

@Berdir
Copy link
Contributor

Berdir commented Nov 10, 2023

Can confirm that drush 12.4 is definitely still broken.

The drupal core implementation falls back to an insert query , the drush PR did not include that, I guess it was based on an earlier implementation and was never updated?

It just gets an ID, but because there's no insert statement, it later on does an update on a non-existing ID.

This is on updating from 10.1 to 10.2 just to clarify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants