6

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?

asked Jun 17, 2021 at 20:03
5
  • 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 Commented Jun 18, 2021 at 8:37
  • 1
    have you tried clearing the generated/code folder? 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. Commented Jul 12, 2021 at 3:15
  • 1
    Related: magento.stackexchange.com/questions/91294/… Commented Jul 1, 2024 at 21:34

6 Answers 6

14

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.

answered Feb 24, 2022 at 14:47
1
  • It helped me, so thank you for that. Commented Jul 17, 2024 at 9:39
8

What solved this for me was regenerating composer:

rm -rf vendor/*
composer clearcache
composer install
then compile magento (setup upgrade.... cache flush)
answered Jun 18, 2021 at 15:36
2
  • Happy to hear you fixed it Commented Jun 20, 2021 at 11:58
  • This should be the accepted answer Commented Aug 8, 2024 at 8:02
1

After hours of research, I found that it can be fixed by a few options:

Solution 1:

rm -rf vendor generated
composer install
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Solution 2: Flush Redis Cache

redis-cli flushall
answered Dec 19, 2024 at 12:57
0

I faced the same problem.

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

answered Oct 13, 2022 at 10:58
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
answered Feb 23, 2023 at 10:51
1
  • This didnt solve my error - Cannot instantiate interface Magento\JwtUserToken\Model\JwtSettingsProviderInterface in /var/www/html/wowshop/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Commented Aug 8, 2024 at 2:51
0

Issue is probably down to accidentally uploading an incorrect version of etc/di.xml. Got the same after I made a change then realised my local copy was out of date! Restored the correct di.xml, made the change to that and all good.

answered Jul 23, 2024 at 14:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.