4

I just installed the latest magento 2 (Magento-CE-2.3.2) and imported a database from another working magento 2 store with Magento 2.3.1.

But if I try to load a product in the frontend, then I get a 500 error and the message

[Wed Jul 17 10:34:29.291844 2019] [php7:error] [pid 10517] [client 192.168.40.161:59517] PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\InventoryReservationsApi\Model\GetReservationsQuantityInterface in /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50\nStack trace:\n#0 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Invento...')\n#1 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Invento...')\n#2 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Invento...', NULL, 'getReservations...', 'Magento\\Invento...')\n#3 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArguments in /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50, referer: http://entwicklung.hausfux.m2/produkte/insektenschutz/fenster/spannrahmen.html

What am I supposed to do? Im new to magento 2.

Update:

I followed the instructions from Muhammad Hasham's answer and also executed bin/magento setup:upgrade, now I get another error.

[Wed Jul 17 11:29:03.970607 2019] [php7:error] [pid 10608] [client 192.168.40.161:63754] PHP Fatal error: Uncaught ReflectionException: Class Magento\Framework\App\ResourceConnection\Proxy does not exist in /srv/www/vhosts/hausfux_m2/vendor/magento/framework/Code/Reader/ClassReader.php:19\nStack trace:\n#0 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...')\n#1 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...')\n#2 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...')\n#3 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')\n#4 /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ in /srv/www/vhosts/hausfux_m2/vendor/magento/framework/Code/Reader/ClassReader.php on line 19, referer: http://entwicklung.hausfux.m2/produkte/insektenschutz/fenster/spannrahmen.html

2
  • Try to run composer upgrade command first. Commented Jul 17, 2019 at 9:01
  • I just tried it, makes no difference. I also cleared cache afterwards.
    – Black
    Commented Jul 17, 2019 at 9:02

2 Answers 2

6

If you use redis, run:

redis-cli flushall

or you'll need to run the following commands:

  • Clear generated
  • Clear var/cache
  • Enable Magento modules: php bin/magento module:enable --all
  • Compile DI php bin/magento setup:di:compile

I hope this will help

9
  • I don't use redis, but the server where I have copied the database from uses redis.
    – Black
    Commented Jul 17, 2019 at 9:23
  • ok if you don't use redis, run the other commands which I mentioned in the answer Commented Jul 17, 2019 at 9:24
  • The folder var/generation does not exist, I cleared var/cache and executed the other two commands, now another error appeared. It says "update your database" so I executed bin/magento setup:upgrade but now I get another 500 error PHP Fatal error: Uncaught ReflectionException: Class Magento\\Framework\\App\\ResourceConnection\\Proxy does not exist
    – Black
    Commented Jul 17, 2019 at 9:29
  • Oh you have to run di:compile and static content deploy after setup:upgrade command. Again run these commands php -dmemory_limit=1G bin/magento setup:upgrade php -dmemory_limit=1G bin/magento setup:di:compile php -dmemory_limit=1G bin/magento setup:static-content:deploy -f php bin/magento cache:clean php bin/magento cache:flush Commented Jul 17, 2019 at 9:32
  • 1
    Glad it helped you. +1 on your question for appreciation. keep coding :) thanks :) Commented Jul 17, 2019 at 10:30
1

For me it was the case where a dependent module was disabled. I didn't have to enable all the modules

php bin/magento module:status

review the modules, and only enable what you think may be the cause

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.