Hello, today I`ve updated my site from Drupal 8.8.6 to Drupal 8.9.0, using Drush as always:

drusch cr
drush pm-update

At the end of the update I saw the following error on my terminal:

Cache rebuild complete. [ok]
Finished performing updates. [ok]
RuntimeException: Zend Diactoros must be installed to use the DiactorosFactory. in Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory->__construct() (line 37 of [error]
/home/pointnet/public_html/vendor/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php) #0
/home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(265): Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory->__construct()
#1 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'psr7.http_messa...')
#2 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('psr7.http_messa...', 1)
#3 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'controller_reso...')
#5 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('controller_reso...', 1)
#6 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#7 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_kernel.bas...')
#8 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('http_kernel.bas...', 1)
#9 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#10 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_middleware...')
#11 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
#12 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#13 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_middleware...')
#14 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
#15 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#16 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_middleware...')
#17 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
#18 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#19 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'ban.middleware')
#20 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('ban.middleware', 1)
#21 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#22 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_middleware...')
#23 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
#24 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#25 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_middleware...')
#26 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('http_middleware...', 1)
#27 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(237):
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#28 /home/pointnet/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array,
'http_kernel')
#29 /home/pointnet/public_html/core/lib/Drupal/Core/DrupalKernel.php(1401): Drupal\Component\DependencyInjection\Container->get('http_kernel')
#30 /home/pointnet/public_html/core/lib/Drupal/Core/DrupalKernel.php(685): Drupal\Core\DrupalKernel->getHttpKernel()
#31 phar:///usr/local/bin/drush/lib/Drush/Boot/DrupalBoot8.php(202): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request),
Object(Symfony\Component\HttpFoundation\Response))
#32 phar:///usr/local/bin/drush/includes/preflight.inc(76): Drush\Boot\DrupalBoot8->terminate()
#33 phar:///usr/local/bin/drush/includes/startup.inc(465): drush_main()
#34 phar:///usr/local/bin/drush/includes/startup.inc(369): drush_run_main(false, '/', 'Phar detected. ...')
#35 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#36 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#37 {main}.
RuntimeException: Zend Diactoros must be installed to use the DiactorosFactory. in Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory->__construct() (line 37 of /home/pointnet/public_html/vendor/symfony/psr-http-message-bridge/Factory/DiactorosFactory.php).
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand.so.5: cannot open shared
object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot
open shared object file: No such file or directory)) in Unknown, line 0

The same message is reported on the error log, but the site seems to work properly.
I do not know how to interpret this error, can you give me some indication please?

Comments

Skin created an issue. See original summary.

cilefen’s picture

What is the drush version?

skin’s picture

Drush version: 8.2.3

cilefen’s picture

Have you tried with a current version of Drush 8?

yasheshb’s picture

I got a similar error right now.

Upgrading Drupal 8.8.6 to 8.9.0

Drush version : 8.3.3

Downloading 8.3.5 and will try on the next Drupal 8 site.

yasheshb’s picture

similar error with Drush 8.3.5
Upgrading Drupal 8.8.6 to 8.9.0

alexpott’s picture

This is a tricky issue. I think it happens because Zend Diactoros has been deprecated by Zend and is now part of Laminas. Drupal 8.9.0 ships with the Laminas version. But Drush at the end of the update is still expecting the Zend version to be around. It's not so it breaks. This type of thing is why in Drush 10 updating the code base is not supported. It tells you to use composer instead. Nothing is broken though. The next time you use Drush it'll get laminas's BC layer and everything will work. Also this is not a core issue it's a Drush as far as I can see. And maybe it can be fixed there - not sure.

greg.1.anderson’s picture

This sort of bug has happened with pm-update in the past, when Drupal switched from Symfony 2 to Symfony 3. Drush makes an attempt to re-exec itself to do the updatedb after updating the code, but the pm-update command itself still touches Drupal after the code has been updated. When dependencies change drastically, sometimes you end up in a situation where code from the new dependencies interacts with classes from the old dependencies that were loaded prior to the code update. You could try running drush pm-updatecode followed by drush updatedb as separate commands. I don't remember if that workaround was helpful last time.

Last time the crash was innocuous, as it happened after Drush was done. Running drush cr one more time would probably be prudent. It's likely that this problem will prove out to be innocuous again, as it was last time, but time will tell.

If anyone wanted to try to fix it, look at the pm-updatecode and pm-update code, and see if there are any calls (direct or indirect) to Drupal APIs, and see if it is possible to avoid doing anything else with Drupal APIs after the code updates. Factoring post-update operations into a separate command called with \Drush::drush() would be an alternative.

feng-shui’s picture

I got this error today going from 8.7 to 8.8 - I was bitten by this (because I had briefly upgraded to 8.9 to take a quick look around): https://www.jeffgeerling.com/blog/2020/watch-out-if-composer-update-keep...

greg.1.anderson’s picture

#7 and #10: This is actually an issue with Drush, not with Drupal or Composer. #3135247: Composer's "prefer-stable" setting cannot be relied on to produce a stable release is unrelated. The fact that the error messages are the same as these Composer issues is superficial.

sokru’s picture

I got the same error with 8.8.7 -> 8.8.8 update, used drush updb. Drush version is 9.7.2.
Edit: fixed by removing vendor directory and running composer update. There was no issue on local / CI.

robpowell’s picture

I also got this error message but I used composer to update from 8.8.7 to 8.8.8. The error message only occurs on Pantheon. My drush version was old @ 8.1.18 but after updating to 8.3.5, the issue persisted.

I am going to try to update to 8.9.x.

damienmckenna’s picture

What I've found is that if you have 8.9.x and need to hotfix to 8.8.8, you need to specifically delete the vendor/laminas directory in order for Composer to download the ZendFramework libraries, and possibly also your ~/.composer/cache directory too.

eiriksm’s picture

Here is another trick you can use:

Edit your composer.json, and add this:

    ...rest of your composer.json
    "conflict": {
        ...could be more things here, for example this:
        "drupal/drupal": "*",
          ...this is the important part
         "laminas/laminas-diactoros": "*"
    },
    ...rest of file

Then remove your vendor folder, and try again. After you have successfully gotten the package back, you can remove the part again (so you are ready for 8.9).

davidwhthomas’s picture

We had this error too (Drupal version 8.8.11), the fix was to:

1. Delete the vendor directory
2. Run composer update

With thanks to https://www.jeffgeerling.com/blog/2020/watch-out-if-composer-update-keep...

grincon’s picture

#13 #16 (same idea) worked for me. Thank you guys.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Status: Active » Closed (outdated)
Issue tags: +Bug Smash Initiative

The error here is for an outdated version of Drupal, therefor closing as outdated.

Explanation of the problem are in #8 and #9. A solution is in #16.

Thanks!

quietone’s picture

Category: Bug report » Support request

Meant to change to a support request based on #8 and #9.