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?
6 Answers 6
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.
- 
 It helped me, so thank you for that.Giles Bennett– Giles Bennett2024年07月17日 09:39:03 +00:00Commented Jul 17, 2024 at 9:39
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 itGohil Rajesh– Gohil Rajesh2021年06月20日 11:58:11 +00:00Commented Jun 20, 2021 at 11:58
- 
 This should be the accepted answerKapil Dev Singh– Kapil Dev Singh2024年08月08日 08:02:29 +00:00Commented Aug 8, 2024 at 8:02
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
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
setup:upgrade
- 
 This didnt solve my error - Cannot instantiate interface Magento\JwtUserToken\Model\JwtSettingsProviderInterface in /var/www/html/wowshop/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121Mohd Farhan Bin Ramli– Mohd Farhan Bin Ramli2024年08月08日 02:51:34 +00:00Commented Aug 8, 2024 at 2:51
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.
generated/codefolder?