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
TypErrors in LegacySevericeInstantiator.php with 12.0.0-RC1 and above #5625
Comments
It appears to me that the line where the error happens was introduced with the first version of the LegacyServiceInstantiator. Seems that there is some object that is optional in the drush.services.yml implementation that is now required by the LegacyServiceInstantiator. The trigger is probably some contrib module with a Drush extension, but I suppose it could be a Drush core command. The fix is to make the LegacyServiceInstantiator work more like the Symfony DI container implementation. |
Your suspicion in regards of the contrib module drush extension might be correct. i've tried a few things:
so it looks like the issue is caused by contrib modules? Update: tried to install project_browser and webprofiler with it's dependency devel and the error doesn't show up there (uninstalled and removed automatic_updates before). so it looks like automatic_updates was the only contrib module that was causing the issue |
This is a completely different error than the one you first reported; this one looks like it should be pretty easy to fix. The original report is a head-scratcher, though; if you find a way to reproduce from a fresh install of Drupal (plus contrib install and enable), it would be very helpful.
If you mess up your composer file when testing alternatives, you can often fix everything and go back to the way things were before by restoring |
OK, we have done some investigation and have discovered that some folks use features of the Symfony DI container that we don't / can't support. So, we're going to pre-validate the drush.services.yml file, and if we see anything we don't understand, we'll just skip the whole file and emit a warning message. So, this means you won't be able to use the Drush commands from incompatible modules when you upgrade to Drush 12, but at least your site won't catch fire, and the module maintainer should, in theory, eventually notice and fix the problem. |
i havent looked close enough at the output i've pasted in the followup comment. on the first look it seemed similar but you are right in detail the pasted snippet and the output from the gist differs signicantly. unfortunately i already removed the project from ddev and i've omitted a snapshot on deletion. therefore i had no db backup available anymore :( but i went ahead and reinstalled the site with the still available codebase and tested around a bit. as I already noted the module that caused the error was potentially automatic updates and with just automatic updates and package manager installed and upgrading to drush 12 i am able to reproduce the error (at least the snippet still looks like on closer look). with package_manager alone there is also no error.:
i did basically the same in the test that lead to the code snippet i'Ve posted in the comment later. the only difference between the setup there and the setup in the issue summary and the snippet here is i've tested on drupal 10.1.x while the other snippet was from an install with drupal 10.0.9. i'll open an issue in the automatic updates queue and also link to this issue for context. |
"Fixed" in #5629, which will disable Automatic Update's Drush command in Drush 12. I already told them that they will need to convert to the static create() factory method, but a formal issue for tracking is probably useful. |
awesome thank you! and cool, i suppose you are at drupalcon then. enjoy your time there! and i've opened an issue for tracking it: https://www.drupal.org/project/automatic_updates/issues/3365206 (and also quoted your proposed resolution) |
Describe the bug
I've upgraded to Drush 12.0.0 yesterday on a Drupal 10.1.0-beta1 site running on DDEV latest HEAD (with PHP 8.2) on MacOS 12.6.1. using Mutagen. i had
drush cr
anddrush updatedb -y
aspost-install-cmd
andpost-update-cmd
in the composer.json'sscripts
section. Drush is installed asrequire-dev
. i immediately ran into the following warnings and type errors: https://gist.github.com/rpkoller/de810e220ea020aad94ac9d987813f40 . i've downgraded to 11.5.1 and removed the scripts section to rule out a potential race condition during the install thatdrush cr
is ran too close after the update. i've upgraded to 12.0.0 again. right after the update i did at first addev restart
and then went into the sites admin interface and cleared the caches there. after that i've retried to runddev drush cr
andddev drush updatedb
. the same errors happened again. i've then changed the project to PHP 8.1 and did addev restart
, the error persisted.I've then downgraded to Drush 12.0.0-beta1 and the error was gone. i then went one version up to 12.0.0-RC1 and the error was back (as seen in the gist). the only difference between 12.0.0-RC1 and 12.0.0 is the line the errors happens.
I've searched the issue queue but was unable to find an issue in relation to LegacySevericeInstantiator.php. I tried to narrow down the problem as close as possible but am out of ideas if it is necessary to narrow things down further (am not a developer). if you need more information or if i should try to debug more let me know please.
To Reproduce
ddev composer require "drush/drush:12.0.0" -W
within the scripts section of the composer.json file
Expected behavior
no errors and all the commands running through as usual
Actual behavior
as mentioned before. that kind of errors get returned no matter what command is run
https://gist.github.com/rpkoller/de810e220ea020aad94ac9d987813f40 (happens even for
ddev drush status
)Workaround
Go back to Drush 12.0.0-beta1 or 11.5.1
System Configuration
Additional information
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: