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?

  • what php version you are using? please switch to 7.4 if not yet switched Commented Jun 18, 2021 at 3:27
  • usign PHP 7.4.20
    – justadev
    Commented Jun 18, 2021 at 8:37
  • have you tried clearing the generated/code folder?
    – Diana
    Commented Jun 18, 2021 at 11:23
  • Had the exact same issue, tried all the above. I realized it was most likely stubborn OPCACHE. If you're smarter than me, you can figure out a way to flush that. I find that rebooting the server is the quickest way to get it done.
    – Corinne
    Commented Jul 12, 2021 at 3:15

4 Answers 4


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.


What solved this for me was regenerating composer:

rm -rf vendor/*
composer clearcache
composer install
then compile magento (setup upgrade.... cache flush)
  • Happy to hear you fixed it Commented Jun 20, 2021 at 11:58

I faced the same problem.

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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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