Magento – Front-end session timeout causes error on checkout and basket pages

cartcheckoutcheckoutsessionmagento-2.1session

When user adds an item(or items) to the cart, it behaves normally. but if user tried to goto either checkot page or basket page after a while, it shows an error page as follows,

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with cartId = 
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with cartId = 
#0 E:\xampp\htdocs\magento_projects\jestic\vendor\magento\module-quote\Model\QuoteRepository.php(197): Magento\Framework\Exception\NoSuchEntityException::singleField('cartId', NULL)
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with cartId = 
#0C:xampp/htdocs/myProject/vendor/magento/module-quote/Model/QuoteRepository.php(197): Magento\Framework\Exception\NoSuchEntityException::singleField('cartId', NULL)
#1C:xampp/htdocs/myProject/vendor/magento/module-quote/Model/QuoteRepository.php(101): Magento\Quote\Model\QuoteRepository->loadQuote('load', 'cartId', NULL, Array)
#2C:xampp/htdocs/myProject/vendor/magento/module-quote/Model/QuoteRepository.php(127): Magento\Quote\Model\QuoteRepository->get(NULL, Array)
#3C:xampp/htdocs/myProject/var/generation/Magento/Quote/Model/QuoteRepository/Interceptor.php(24): Magento\Quote\Model\QuoteRepository->getActive(NULL, Array)
#4C:xampp/htdocs/myProject/vendor/magento/module-quote/Model/Quote/Item/Repository.php(69): Magento\Quote\Model\QuoteRepository\Interceptor->getActive(NULL)
#5C:xampp/htdocs/myProject/vendor/magento/module-checkout/Model/Cart/ImageProvider.php(44): Magento\Quote\Model\Quote\Item\Repository->getList(NULL)
#6C:xampp/htdocs/myProject/vendor/magento/module-checkout/Model/DefaultConfigProvider.php(278): Magento\Checkout\Model\Cart\ImageProvider->getImages(NULL)
#7C:xampp/htdocs/myProject/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Checkout\Model\DefaultConfigProvider->getConfig()
#8C:xampp/htdocs/myProject/var/generation/Magento/Checkout/Model/DefaultConfigProvider/Interceptor.php(26): Magento\Checkout\Model\DefaultConfigProvider\Interceptor->___callPlugins('getConfig', Array, Array)
#9C:xampp/htdocs/myProject/vendor/magento/module-checkout/Model/CompositeConfigProvider.php(32): Magento\Checkout\Model\DefaultConfigProvider\Interceptor->getConfig()
#10C:xampp/htdocs/myProject/vendor/magento/module-checkout/Block/Cart/Shipping.php(54): Magento\Checkout\Model\CompositeConfigProvider->getConfig()

and so on..

This happens when user tries to click on minicart icon before site gets fully loaded. (icon is clickable before site gets fully loaded and it linked to http://localhost/myProject/checkout/cart/)

I think usually there should be some standard web page with error message rather than showing errors like this.

What is wrong here? How can I fix this? please help…

Best Answer

A similar issue is reported in Magento's GitHub issues list. This issue is resolved in Magento 2.2 as informed here in this comment.

https://github.com/magento/magento2/issues/6522#issuecomment-334663929

Also, you can verify the commit ID referenced in the above comment. The commit can be seen here - https://github.com/magento/magento2/commit/e93c44e66d256836c18e6a5e7e9f24623f05e25b

If you update your Magento website to it's latest stable release, issue should not occur.

Related Topic