Hi,
I upgraded magento CE 2.1.9 to CE 2.2.0 and now I get an exception when trying to filter by category in the layered navigation. My base category is set as anchor and when I select a sub category I get the following error:
1 exception(s): Exception #0 (Magento\Framework\Exception\StateException): Bucket does not exist Exception #0 (Magento\Framework\Exception\StateException): Bucket does not exist #0 /var/www/html/generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(115): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->getFacetedData('category') #1 /var/www/html/vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php(111): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->getFacetedData('category') #2 /var/www/html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(202): Magento\CatalogSearch\Model\Layer\Filter\Category->_getItemsData() #3 /var/www/html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(159): Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems() #4 /var/www/html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(148): Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems() ...
I'm completely stuck with this. Does anyone has a clue about this?
Thanks!
I've got the same problem. Any solutions?
I am also facing same error after upgrading magento from 2.1.9 to 2.2.2. Is there any solution ??
Have you resolved this error??
I have added below code on above "Bucket does not exist" condition. Because we are showing subcategories on main category pages. So we don't need filters. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category'); if($category && $category->getIsAnchor() == '0'){ return ''; } if (!$bucket) { throw new StateException(new Phrase('Bucket does not exist')); }
You have to set the Root category to Anchored -> 'Yes'. If it is set already as 'Yes', you have set it again to 'No' and 'Save' and then again into 'Yes' -> 'Save'. This should resolve your problem.
This is a known issue in Magento2.
You have to set the Root category to Anchored -> 'Yes'. If it is set already as 'Yes', you have set it again to 'No' and 'Save' and then again into 'Yes' -> 'Save'. This should resolve your problem.
This is a known issue in Magento2.
The last solution did not work for me to solve this "bucket does not exist" issue, but I found a workaround, set "is anchor" to the the sub-categories as well. It did the trick for me.
Thank so much. It's work for me
I had this issue today on search results pages.
What worked was running bin/magento indexer:reindex catalog_category_product