1

When doing an upgrade from Magento 2.2.2 to Magento 2.2.4 I get the following when running php bin/magento setup:upgrade

Cache cleared successfully
File system cleanup:
.....
....
...
Module 'Magefan_Community':
Module 'Magento_Sales':
Upgrading data.. PHP Fatal error:  Uncaught Error: Call to a member function setFinalPrice() on null in /Sites/example/vendor/magento/module-quote/Model/Quote/Item/AbstractItem.php:155
Stack trace:
#0 /Sites/example/vendor/magento/module-catalog-inventory/Model/Quote/Item/QuantityValidator.php(130): Magento\Quote\Model\Quote\Item\AbstractItem->getProduct()
#1 /Sites/example/vendor/magento/module-catalog-inventory/Observer/QuantityValidatorObserver.php(34): Magento\CatalogInventory\Model\Quote\Item\QuantityValidator->validate(Object(Magento\Framework\Event\Observer))
#2 /Sites/example/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Magento\CatalogInventory\Observer\QuantityValidatorObserver->execute(Object(Magento\Framework\Event\Observer))
#3 /Sites/example/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\CatalogInventory\Observer in /Sites/example/vendor/magento/module-quote/Model/Quote/Item/AbstractItem.php on line 155

I am guessing this is an issue with data within the database as I have upgraded other sites before and not had this issue however not sure where to start debugging or how to fix the issue. Could anyone advise

Update If I truncate quote, quote_address, quote_address_item, quote_item, quote_item_option tables then php bin/magento setup:upgrade works though I lose all my data :-(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.