3

I was trying to upgrade from magento 2.3.6 to 2.4.2.

Now I have an issue that any php bin/magento command is giving an error:

PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Framework\Interception\ConfigLoaderInterface in /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()
#1 /var/www/html/vendor/magento/framework/Interception/PluginList/PluginList.php(136): Magento\Framework\ObjectManager\ObjectManager->get()
#2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): Magento\Framework\Interception\PluginList\PluginList->__construct()
#3 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#4 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()
#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.ph in /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

I tried things like clear cache, redis flushall, but nothing helps. Any way to fix this?

justadev
  • 235
  • 1
  • 2
  • 11

4 Answers4

9

Check your app/etc/di.xml.

I had the same error and it looked like the absence of this line:

<preference for="Magento\Framework\Interception\ConfigLoaderInterface" type="Magento\Framework\Interception\PluginListGenerator" />

At the bottom of the preferences block. This was what was causing the Fatal Error message in my case.

However, the best thing to do is merge your di.xml with the 2.4 release di.xml.

I know it's been 7 months since you asked this question, so I hope this helps someone.

Thomas Harding
  • 626
  • 5
  • 19
3

What solved this for me was regenerating composer:

rm -rf vendor/*
composer clearcache
composer install
then compile magento (setup upgrade.... cache flush)
justadev
  • 235
  • 1
  • 2
  • 11
0

I faced the same problem.

I just ran the "composer install" command and got it fixed.

0

Quickest solution for me was to remove vendor, run composer update and then setup:upgrade. Resolved issue within 2 minutes

rm -fr vendor
composer update
setup:upgrade
elfling
  • 768
  • 4
  • 18