0

I have updated Composer to 2.4.4 as a prerequisite to updating Magento to 2.4.5, however now I'm getting errors in SSH when trying to run any other command and HTTP on a page execution:

SSH:

In AutoloadGenerator.php line 1351:
                                                                                                                                                                         
  require(/home/---/web/---/public_html/vendor/magento/composer-root-update-plugin/registration.php): failed to open stream: No such file or directory

HTTP:

Warning: require(/home/---/web/---/public_html/vendor/composer/../magento/composer-root-update-plugin/registration.php): failed to open stream: No such file or directory in /home/xadmin/web/xdev.devsetup.co.uk/public_html/vendor/composer/autoload_real.php on line 59

Fatal error: require(): Failed opening required '/home/---/web/---/public_html/vendor/composer/../magento/composer-root-update-plugin/registration.php' (include_path='/home/xadmin/web/xdev.devsetup.co.uk/public_html/vendor/magento/zendframework1/library:.:/usr/share/php') in /home/---/web/---/public_html/vendor/composer/autoload_real.php on line 59

Composer won't rollback - tried that and received the same errors. Confirmed the file doesn't exist, but the directory does.

I'm assuming /public_html/vendor/composer/../magento/composer-root-update-plugin/ in the HTTP error is the same as /public_html/vendor/magento/composer-root-update-plugin/ in SSH, but posted in case it helps you help me.

Does anyone know how I can get past this?

Thanks

3 Answers 3

2

You don't need to upgrade to Magento 2.4.4 before upgrading to Magento 2.4.5. You can upgrade to Magento 2.4.5 directly.

Solution 1: Try the following steps to upgrade your Magento site to 2.4.5-p1:

  1. Switch back to your old PHP version, ie. PHP 7.4 or 7.3
  2. Run the following commands:
composer require magento/composer-root-update-plugin ~2.0 --no-update
composer update
rm -rf var/cache/* var/page_cache/* generated/*
bin/magento setup:upgrade
composer require-commerce magento/product-community-edition 2.4.5-p1 --no-update
composer update
  1. Change to PHP version 8.1
  2. Run the following commands:
rm -rf var/cache/* var/page_cache/* generated/*
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Solution 2: (This solution resolved the issue for @myshadowself)

Take the following steps:

  1. Remove vendor directory and clear composer cache:
rm -rf vendor
composer clear-cache
  1. Update require-dev section in your composer.json file same as the Magento codebase: https://github.com/magento/magento2/blob/2.4.5-p1/composer.json#L108

  2. Remove manually magento/composer-root-update-plugin from require in composer.json

  3. Run thee following commands:

composer remove magento/product-community-edition --no-update
composer require-commerce magento/product-community-edition 2.4.5-p1 --no-update
composer update
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

You're done.

Troubleshooting:

If you had the below error when running bin/magento setup:upgrade

"Class "Vertex\Tax\Setup\Schema\Triggers\MigrateVertexInvoiceSent" not found#0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()"

Remove generated folder then run bin/magento setup:upgrade again:

rm -rf generated
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
9
  • I was hoping you'd drop by Tu Van, I've been watching your bug hunts for a while! Currently on my way home, but I'll try this in the morning. Thanks :) Nov 9, 2022 at 16:59
  • 1
    Yeah, hope that helps you resolve your issue. If you have any issues, feel free to let me know.
    – Tu Van
    Nov 9, 2022 at 17:02
  • Hi I get as far as composer require-commerce magento/product-community-edition 2.4.5-p1 --no-update but receive new errors: Posted below... Nov 10, 2022 at 11:13
  • Deprecation Notice: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/--/web/--/public_html/vendor/magento/composer-root-update-plugin/Utils/PackageUtils.php:128 In RootPackageRetriever.php line 517: Nov 10, 2022 at 11:14
  • 1
    did you run composer require magento/composer-root-update-plugin ~2.0 --no-update before?
    – Tu Van
    Nov 10, 2022 at 11:24
1

You can try this:

rm -rf vendor
composer install
composer update
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

or you can remove composer.lock and then ran above command.

Hopefully this may help you.

0

After running composer update in solution 1 I get this:

  • php-amqplib/php-amqplib v3.2.0 conflicts with php 7.4.0 - 7.4.1.

Our dev server has both php7.4 and php8.1 on it. I have to specify php7.4 for any php bin/magento commands but what about the composer command? Andy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.