cancel
Showing results for 
Search instead for 
Did you mean: 

Error updating 2.4.3-p1 to 2.4.4

Error updating 2.4.3-p1 to 2.4.4

I'm trying to upgrade a cloud sandbox project to 2.4.4. I changed the cloud metapackage depdendency in composer.json from:
 
"magento/magento-cloud-metapackage": ">=2.4.3 <2.4.4"
 
to 
 
"magento/magento-cloud-metapackage": ">=2.4.4 <2.4.5"
 
And changed the PHP dependency to 8.1 in .magento.app.yaml. After pushing the changes I get this error on the deployment log (in either integration branches or master):
 
 W: > php ./vendor/bin/ece-tools schema:generate || true
    W: PHP Fatal error:  During inheritance of Countable: Uncaught RuntimeException: Deprecated Functionality: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php on line 286 in /app/vendor/magento/ece-tools/src/App/ErrorHandler.php:68
    W: Stack trace:
    W: #0 /app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php(29): Magento\MagentoCloud\App\ErrorHandler->handle(8192, 'Return type of ...', '/app/vendor/com...', 286)
    W: #1 /app/vendor/composer/ClassLoader.php(571): include('/app/vendor/com...')
    W: #2 /app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/app/vendor/com...')
    W: #3 /app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php(32): Composer\Autoload\ClassLoader->loadClass('Composer\\Reposi...')
    W: #4 /app/vendor/composer/ClassLoader.php(571): include('/app/vendor/com...')
    W: #5 /app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/app/vendor/com...')
    W: #6 /app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php(401): Composer\Autoload\ClassLoader->loadClass('Composer\\Reposi...')
    W: #7 /app/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php(75): Composer\Package\Loader\ValidatingArrayLoader::hasPackageNamingError('magento/magento...')
    W: #8 /app/vendor/composer/composer/src/Composer/Factory.php(377): Composer\Package\Loader\RootPackageLoader->load(Array, 'Composer\\Packag...', '/app')
    W: #9 /app/vendor/magento/ece-tools/src/App/Container.php(87): Composer\Factory->createComposer(Object(Composer\IO\BufferIO), Array, false, '/app')
    W: #10 /app/vendor/magento/ece-tools/src/App/Container.php(50): Magento\MagentoCloud\App\Container->createComposerInstance(Object(Magento\MagentoCloud\Filesystem\SystemList))
    W: #11 /app/vendor/magento/ece-tools/bootstrap.php(17): Magento\MagentoCloud\App\Container->__construct('/app/vendor/mag...', '/app')
    W: #12 /app/vendor/magento/ece-tools/bin/ece-tools(7): require('/app/vendor/mag...')
    W: #13 /app/vendor/bin/ece-tools(117): include('/app/vendor/mag...')
    W: #14 {main} in /app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php on line 29
It seems to be related to the Composer dependency in the vendor folder, but I can't figure out how to tell Magento to use a more recent one. Not sure if this is the exact error. Any suggestion will be more than welcome.
5 REPLIES 5

Re: Error updating 2.4.3-p1 to 2.4.4

Hi Agustin,

 

I have been having a similar issue, did you manage to resolve it?

 

Thanks
Paul

Re: Error updating 2.4.3-p1 to 2.4.4

Have the same issue with php 8.1. Any solutions or suggestions how to fix it?

Re: Error updating 2.4.3-p1 to 2.4.4

I found that we also need to update composer root update plugin. Maybe it helps to somebody 

composer require magento/composer-root-update-plugin ~2.0 --no-update

Re: Error updating 2.4.3-p1 to 2.4.4

I fixed this by updating symfony/console. The original requirement in my composer.json was 4.4.26. I changed it to ~4.4.0 and ran composer update so it would install the latest version of 4.4.x. In my case, I ended up with 4.4.44 and I no longer see the PHP error.

Re: Error updating 2.4.3-p1 to 2.4.4

You can use the following url to read more about the composer-root-update-plugin.

 

https://github.com/magento/composer-root-update-plugin/tree/develop/src/Magento/ComposerRootUpdatePl...

 

When upgrading to a new version, first run below command. This makes sure that your root composer.json dependencies are updated to reflect the new magento version. After that run `composer update` to upgrade magento to the new version.

composer require-commerce magento/product-community-edition 2.4.4 --no-update --verbose