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
Comment #2
cilefen commentedWhat is the drush version?
Comment #3
skinDrush version: 8.2.3
Comment #4
cilefen commentedHave you tried with a current version of Drush 8?
Comment #5
yasheshb commentedI 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.
Comment #6
yasheshb commentedsimilar error with Drush 8.3.5
Upgrading Drupal 8.8.6 to 8.9.0
Comment #7
cilefen commented#3135247-16: Composer's "prefer-stable" setting cannot be relied on to produce a stable release
Comment #8
alexpottThis 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.
Comment #9
greg.1.anderson commentedThis 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.
Comment #10
feng-shui commentedI 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...
Comment #11
greg.1.anderson commented#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.
Comment #12
sokru commentedI 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.Comment #13
robpowellI 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.
Comment #14
damienmckennaWhat 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.
Comment #15
eiriksmHere is another trick you can use:
Edit your composer.json, and add this:
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).
Comment #16
davidwhthomas commentedWe had this error too (Drupal version 8.8.11), the fix was to:
1. Delete the
vendordirectory2. Run
composer updateWith thanks to https://www.jeffgeerling.com/blog/2020/watch-out-if-composer-update-keep...
Comment #17
grincon commented#13 #16 (same idea) worked for me. Thank you guys.
Comment #20
quietone commentedThe 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!
Comment #21
quietone commentedMeant to change to a support request based on #8 and #9.