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 Jun 18, 2021 at 3:27
  • usign PHP 7.4.20
    – justadev
    Jun 18, 2021 at 8:37
  • have you tried clearing the generated/code folder?
    – Diana
    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
    Jul 12, 2021 at 3:15

2 Answers 2


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 Jun 20, 2021 at 11:58

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.