0

In 2 of my 3 Drupal websites, drush updb crashes with the following error after upgrading from Drupal 9.5.11 to Drupal 10.2.2.

In BatchStorage.php line 143:
  [Exception]
  Serialization of 'Closure' is not allowed
Exception trace:
  at /var/www/html/drupal/web/core/lib/Drupal/Core/Batch/BatchStorage.php:143
 serialize() at /var/www/html/drupal/web/core/lib/Drupal/Core/Batch/BatchStorage.php:143
 Drupal\Core\Batch\BatchStorage->create() at /var/www/html/drupal/web/core/lib/Drupal/Core/ProxyClass/Batch/BatchStorage.php:107
 Drupal\Core\ProxyClass\Batch\BatchStorage->create() at /var/www/html/drupal/web/vendor/drush/drush/includes/batch.inc:146
 _drush_backend_batch_process() at /var/www/html/drupal/web/vendor/drush/drush/includes/batch.inc:55
 drush_backend_batch_process() at /var/www/html/drupal/web/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php:410
 Drush\Commands\core\UpdateDBCommands->updateBatch() at /var/www/html/drupal/web/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php:73
 Drush\Commands\core\UpdateDBCommands->updatedb() at n/a:n/a
 call_user_func_array() at /var/www/html/drupal/web/vendor/consolidation/annotated-command/src/CommandProcessor.php:276
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/html/drupal/web/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/html/drupal/web/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/html/drupal/web/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:391
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/html/drupal/web/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/html/drupal/web/vendor/symfony/console/Application.php:1096
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/drupal/web/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/html/drupal/web/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/html/drupal/web/vendor/drush/drush/src/Runtime/Runtime.php:110
 Drush\Runtime\Runtime->doRun() at /var/www/html/drupal/web/vendor/drush/drush/src/Runtime/Runtime.php:40
 Drush\Runtime\Runtime->run() at /var/www/html/drupal/web/vendor/drush/drush/drush.php:139
 require() at /var/www/html/drupal/web/vendor/drush/drush/drush:4
 include() at /var/www/html/drupal/web/vendor/bin/drush:120
``

Website is not down and I can access the back-end, but it can't stay like this.

I followed [How to upgrade from Drupal 9 to Drupal 10][1].

Do you have any idea?

I'll try to spot differences with my 3rd website which has well supported the upgrade.
















  [1]: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/how-to-upgrade-from-drupal-9-to-drupal-10
4
  • 3
    What version of drush are you using? Try temporarily removing drush with composer. Feb 7 at 10:44
  • 1
    Yeah the error says something with Drush. Drush version and PHP version would be first thing to check.
    – leymannx
    Feb 7 at 11:53
  • Using Drush 12.4.3.0, PHP 8.1.13 Feb 7 at 13:12
  • Could be your composer is too old. Try composer self-update and then composer dump-autoload
    – 4uk4
    Feb 7 at 20:45

1 Answer 1

1

As @4uk4 points out, this issue happened to me because of an old composer. Updating composer to its latest version and dumping autoload worked for me:

composer.phar self-update
composer.phar dump-autoload

After that, I could update the DB with no further issues:

/vendor/bin/drush updb --verbose

I got this from https://www.drupal.org/project/drupal/issues/3098942#comment-15378094

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.