When we used Composer to update to the latest version of Upgrade Status, then ran drush updb, we were greeted with this error:
[error] TypeError: Argument 1 passed to Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer::__construct() must be an instance of Drupal\Core\DependencyInjection\Container, instance of Drupal\Core\DependencyInjection\ContainerBuilder given in Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct() (line 39 of [docroot]/modules/contrib/upgrade_status/src/ThemeFunctionDeprecationAnalyzer.php) #0 [internal function]: Drupal\upgrade_status\ThemeFunctionDeprecationAnalyzer->__construct(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
It seems that this error occurs because we're running PHP 7.2 in our environment (which is still a fully supported version in Drupal 8) but Upgrade Status 8.x-2.2 requires PHP 7.3+.
Composer.json should be modified to specify that "php": "^7.3.0" is required for Upgrade Status 8.x-2.2. This should also be extended to other applicable Drupal info files, as well as the project documentation. The current alternative for folks who are still on PHP 7.2 is to specify "drupal/upgrade_status": "2.0" instead of "^2.0" and remember to change it when our environment is up to PHP 7.3.
Thanks in advance!
Comments
Comment #2
gábor hojtsyI don't think that is PHP 7.3 related. #3126600: Upgrade status scans fail with error 500 due to HTTP request issues, make HTTP request testing more specific has a patch for it. The constructor should have type hinted on the container interface to begin with.
Comment #3
gábor hojtsyThat said the into file has a PHP 7.1 requirement that should be reflected in the composer.json. Do you still believe PHP 7.3 is a requirement after applying the patch from #3126600: Upgrade status scans fail with error 500 due to HTTP request issues, make HTTP request testing more specific?
Comment #4
gábor hojtsyComment #5
andrewmacpherson commentedI updated to 8.x-2.2 today and soon encountered this error. I have
drupal/upgrade_statusas arequire-devdependency of my project, but the module isn't actually enabled most of the time. (It's disabled on production, and I list it among$settings['config_exclude_modules']).I encountered the bug during
drush config-import -y. The Upgrade Status module wasn't enabled at the time. I also encountered it duringdrush updblike @hunterbuchanan found.I tried the patch from #3126600-2: Upgrade status scans fail with error 500 due to HTTP request issues, make HTTP request testing more specific as you suggest, and the problems went away. The following all succeeded:
drush config-importdrush updbdrush us-adrush us-csadmin/reports/upgrade-statuscomposer why phpsays I don't have anything which requires PHP 7.3 in my Composer project.I use Docksal as my local dev environment. My linux host has PHP 7.3, but the Docksal container has PHP 7.2. Running
rm -rf ./vendor && composer installworks regardless of whether I run it on the host or inside the container.Note that the Drush commands I mentioned above were running inside the Docksal container via
fin drush ..., i.e. they succeeded with the container's PHP 7.2.My Drupal core version is 8.8.5.
Comment #6
gábor hojtsyComment #8
gábor hojtsyCrediting @floown for duplicate issue #3127150: Error with drush updb with upgrade_status update
Comment #10
gábor hojtsyCrediting @extect for duplicate issue #3126600: Upgrade status scans fail with error 500 due to HTTP request issues, make HTTP request testing more specific.
Comment #12
gábor hojtsyCommitted the fix from #3126600: Upgrade status scans fail with error 500 due to HTTP request issues, make HTTP request testing more specific for this issue, given that there is still outstanding problems there to resolve the original scope there. Thanks for all the reports and verification. Especially @andrewmacpherson for your detailed report. Planning to release this soon, ideally with the remaining scope of #3126600: Upgrade status scans fail with error 500 due to HTTP request issues, make HTTP request testing more specific resolved and #3126949: Missing requirement in composer.json should not generate a warning.
Comment #13
hunterbuchanan commentedThanks to everyone for looking into this! Admittedly, I made the assumption that PHP 7.2 vs 7.3 was part of the issue because our developer said he saw "PHP version should be at least 7.3.0" somewhere in the interface. Regardless, we'll update to the latest dev, I'm guessing it will work fine, and I look forward to seeing that fix included in a new version release in the near future. If I still see a problem with the dev version, I'll let you know right away.
Sorry about the red herring in the original title!