magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Filtering catalog by non-anchor category throws "Bucket does not exist" exception #13823

Closed tgerulaitis closed 5 years ago

tgerulaitis commented 6 years ago

Preconditions

  1. Magento Open Source 2.2.2 with sample data installed
  2. One of the catalog sub-categories (e.g. Women > Tops > Hoodies & Sweatshirts) is configured to not be anchored ("Anchor" set to "No")

Steps to reproduce

  1. Navigate to a parent category of the configured sub-category (e.g. Women > Tops) on the frontend
  2. In the layered navigation filters, filter by the configured sub-category (e.g. Hoodies & Sweatshirts)

Expected result

  1. The category page refreshes, with the sub-category filter applied

Actual result

  1. (Magento\Framework\Exception\StateException): Bucket does not exist exception is thrown.
screenshot 2018-02-23 11 11 53
magento-engcom-team commented 6 years ago

@tgerulaitis , thank you for your report. We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation or latest release.

tgerulaitis commented 6 years ago

More detailed steps to reproduce:

  1. On Magento CE 2.2.2 with sample data
  2. In the backend:
    1. Navigate to Catalog > Categories
    2. Edit the Women > Tops > Hoodies & Sweatshirts category
    3. Set "Anchor" to "No" in the "Display Settings" section and click the Save button
    4. Flush cache
  3. In the frontend:
    1. Navigate to the Women > Tops category (/women/tops-women.html)
    2. In the left column, click on the "Category" filter
    3. Click on "Hoodies & Sweatshirts" to filter by it

Let me know if I should update the original post with these.

magento-engcom-team commented 6 years ago

@tgerulaitis , thanks for you update, but we not reproduced this issue on fresh installiation Magento 2.2.2 with sample data, see attachments admin_cat-iloveimg-cropped

front_cat1-iloveimg-cropped

front_cat2-iloveimg-cropped

Maybe this issue is related for environment

tgerulaitis commented 6 years ago

Hmm, I've also tried a few different environments and so far was only able to replicate it in Docker, so it's not out of the question. However, from the debugging I've done so far I don't see how the environment could affect this. Looking at the code:

  1. The \Magento\Framework\Api\Search\SearchCriteriaBuilder returns two separate filters for categories - one from the category page collection, and one from the layered navigation filter.
  2. Then in \Magento\Framework\Search\Search:65 the filters are added to the search request builder, but since the two category filters have the same field (category_ids), only the latter one is added to the builder.
  3. When \Magento\Framework\Search\Adapter\Mysql\Adapter creates aggregations in line 84, an empty array is returned because \Magento\CatalogSearch\Model\Adapter\Aggregation\Checker\Query\CatalogView::isApplicable method only returns aggregations for categories that are anchored and it only checks the category added by the filter (not the category page collection).
  4. \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection::getFacetedData looks for category aggregations in the search result, but none were returned, so an exception is thrown.

None of this code seems to be dependent on any environment settings, so I'm still not sure how to fix it (other than making all categories anchored as suggested somebody else's stackexchange question).

I'll try and get another environment set up locally that doesn't experience this bug so I can debug and see what's different.

tgerulaitis commented 6 years ago

Could this be dependent on the PHP version? I'm using PHP 7.1 locally.

tgerulaitis commented 6 years ago

I've also noticed that in at least one of the environments where the page loaded successfully, the exception still happened, but it just got logged in var/log/system.log instead of bubbling up to the response:

[tg@185 current]$ tail -n3 var/log/system.log
[2018-02-26 16:12:42] main.CRITICAL: Bucket does not exist [] []
[2018-02-26 16:19:41] main.CRITICAL: Bucket does not exist [] []
[2018-02-26 16:28:50] main.CRITICAL: Bucket does not exist [] []

Not sure yet what's causing it to just be logged instead of surfacing it (it's not tied to deployment mode as far as I can see).

magento-engcom-team commented 6 years ago

@tgerulaitis, thank you for your report. We've acknowledged the issue and added to our backlog.

samanaveen commented 6 years ago

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'));
    }
gnysek commented 6 years ago

Saving "Default Category" from admin helps if this happens on search result case, as even if it says that "is anchor" is enabled, it may be not in database. After saving, this settings is properly applied and filters should show on search results.

dankoz51 commented 6 years ago

I am getting this on but it does seem to go away in production mode.

inkobject commented 6 years ago

Just ran into this issue on 2.2.3. Can be seen on my dev site for the next day or so: Go to https://z9t.tech/2230/plants on right, select bottom most category: Archive Which leads to https://z9t.tech/2230/plants?cat=31 (kaplooey!). That category is set Anchor:No If I set the category to Anchor:Yes, the problem goes away, But for my purposes, I need it set to Anchor:No Fortunately accessing the page via URL rewrite for that category: https://z9t.tech/2230/plants/archive, does appear to function properly.

As a work around I will probably hide that line in the 'Refine By' navigation with CSS, since I dont need that link there.

Also, wondering whether an an htaccess redirect of https://z9t.tech/2230/plants?cat=31 to https://z9t.tech/2230/plants/archive could be a temporary solution... It takes the user away from the page they are on but at least it doesn't blow up.

@dankoz51 good to know you see it resolving in production. I'll take a closer look once I get there...some day.

northdakota commented 6 years ago

I have the same problem, in my case error is reproduced on search page with elastic search enabled.

rpelorosso commented 6 years ago

Is there any news on this issue? I have the same problem.

alexbogias commented 5 years ago

Same here.. 2.2.6

magento-engcom-team commented 5 years ago

Hi @TomashKhamlai. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

TomashKhamlai commented 5 years ago

We tested on Magento 2.3.0 with Sample Data running on docker with powered by PHP 7.1 and there was no such error in var/log/system.log`

image

Zyles commented 5 years ago

I have this issue in 2.3.0 with PHP 7.1.

If i set Anchor to "No" and I click it in the left category filter I get"Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist." error.

giacmir commented 5 years ago

I have this issue with 2.3 and ES 5. Seems related to this https://magento.stackexchange.com/questions/256157/magento-2-3-elastic-search-5-0-error-on-some-pages

jimmybsilva commented 5 years ago

Magento ver. 2.3.1 php 7.2 rc

1 exception(s): Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.

Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.

#1 Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->getFacetedData('category') called at [vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php:113]
#2 Magento\CatalogSearch\Model\Layer\Filter\Category->_getItemsData() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:202]
#3 Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:159]
#4 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:148]
#5 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItemsCount() called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:33]
#6 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->canShowOptions(array(&Magento\CatalogSearch\Model\Layer\Filter\Category#000000002f75e914000000001cf71f13#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#000000002f75e904000000001cf71f13#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#000000002f75e913000000001cf71f13#, &Magento\CatalogSearch\Model\Layer\Filter\Price#000000002f75e90a000000001cf71f13#)) called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:23]
#7 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->isEnabled(&Magento\Catalog\Model\Layer\Category\Interceptor#000000002f75e8a0000000001cf71f13#, array(&Magento\CatalogSearch\Model\Layer\Filter\Category#000000002f75e914000000001cf71f13#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#000000002f75e904000000001cf71f13#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#000000002f75e913000000001cf71f13#, &Magento\CatalogSearch\Model\Layer\Filter\Price#000000002f75e90a000000001cf71f13#)) called at [vendor/magento/module-layered-navigation/Block/Navigation.php:110]
#8 Magento\LayeredNavigation\Block\Navigation->canShowBlock() called at [app/design/frontend/Alothemes/default/Magento_LayeredNavigation/templates/layer/view.phtml:18]
#9 include('/home/runcloud/w...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#10 Magento\Framework\View\TemplateEngine\Php->render(&Magento\LayeredNavigation\Block\Navigation#000000002f75e940000000001cf71f13#, '/home/runcloud/w...', array()) called at [vendor/magento/framework/View/Element/Template.php:271]
#11 Magento\Framework\View\Element\Template->fetchView('/home/runcloud/w...') called at [vendor/magento/framework/View/Element/Template.php:301]
#12 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:668]
#13 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:557]
#14 Magento\Framework\View\Layout->_renderBlock('catalog.leftnav') called at [vendor/magento/framework/View/Layout.php:533]
#15 Magento\Framework\View\Layout->renderNonCachedElement('catalog.leftnav') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#16 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('catalog.leftnav') called at [vendor/magento/framework/View/Layout.php:488]
#17 Magento\Framework\View\Layout->renderElement('catalog.leftnav', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#18 Magento\Framework\View\Layout\Interceptor->renderElement('catalog.leftnav', false) called at [vendor/magento/framework/View/Layout.php:585]
#19 Magento\Framework\View\Layout->_renderContainer('sidebar.main', false) called at [vendor/magento/framework/View/Layout.php:535]
#20 Magento\Framework\View\Layout->renderNonCachedElement('sidebar.main') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#21 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('sidebar.main') called at [vendor/magento/framework/View/Layout.php:488]
#22 Magento\Framework\View\Layout->renderElement('sidebar.main', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#23 Magento\Framework\View\Layout\Interceptor->renderElement('sidebar.main', false) called at [vendor/magento/framework/View/Layout.php:585]
#24 Magento\Framework\View\Layout->_renderContainer('div.sidebar.main', false) called at [vendor/magento/framework/View/Layout.php:535]
#25 Magento\Framework\View\Layout->renderNonCachedElement('div.sidebar.main') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#26 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('div.sidebar.main') called at [vendor/magento/framework/View/Layout.php:488]
#27 Magento\Framework\View\Layout->renderElement('div.sidebar.main', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#28 Magento\Framework\View\Layout\Interceptor->renderElement('div.sidebar.main', false) called at [vendor/magento/framework/View/Layout.php:585]
#29 Magento\Framework\View\Layout->_renderContainer('columns', false) called at [vendor/magento/framework/View/Layout.php:535]
#30 Magento\Framework\View\Layout->renderNonCachedElement('columns') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#31 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns') called at [vendor/magento/framework/View/Layout.php:488]
#32 Magento\Framework\View\Layout->renderElement('columns', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#33 Magento\Framework\View\Layout\Interceptor->renderElement('columns', false) called at [vendor/magento/framework/View/Layout.php:585]
#34 Magento\Framework\View\Layout->_renderContainer('main.container', false) called at [vendor/magento/framework/View/Layout.php:535]
#35 Magento\Framework\View\Layout->renderNonCachedElement('main.container') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#36 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.container') called at [vendor/magento/framework/View/Layout.php:488]
#37 Magento\Framework\View\Layout->renderElement('main.container', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#38 Magento\Framework\View\Layout\Interceptor->renderElement('main.container', false) called at [vendor/magento/framework/View/Layout.php:585]
#39 Magento\Framework\View\Layout->_renderContainer('main.content.fix', false) called at [vendor/magento/framework/View/Layout.php:535]
#40 Magento\Framework\View\Layout->renderNonCachedElement('main.content.fix') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#41 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content.fix') called at [vendor/magento/framework/View/Layout.php:488]
#42 Magento\Framework\View\Layout->renderElement('main.content.fix', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#43 Magento\Framework\View\Layout\Interceptor->renderElement('main.content.fix', false) called at [vendor/magento/framework/View/Layout.php:585]
#44 Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:535]
#45 Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#46 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper') called at [vendor/magento/framework/View/Layout.php:488]
#47 Magento\Framework\View\Layout->renderElement('page.wrapper', true) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#48 Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper') called at [vendor/magento/framework/View/Layout.php:954]
#49 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#50 Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', array()) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#51 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#52 Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', array(), array(array('layout-model-cac...'))) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:494]
#53 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]
#54 Magento\Framework\View\Result\Page->render(&Magento\Framework\App\Response\Http\Interceptor#000000002f75ec32000000001cf71f13#) called at [vendor/magento/framework/View/Result/Layout.php:171]
#55 Magento\Framework\View\Result\Layout->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000002f75ec32000000001cf71f13#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#56 Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', array(&Magento\Framework\App\Response\Http\Interceptor#000000002f75ec32000000001cf71f13#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#57 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Response\Http\Interceptor#000000002f75ec32000000001cf71f13#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#58 Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', array(&Magento\Framework\App\Response\Http\Interceptor#000000002f75ec32000000001cf71f13#), array(array('result-messages', 'result-builtin-c...', 'result-varnish-c...'))) called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130]
#59 Magento\Framework\View\Result\Page\Interceptor->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000002f75ec32000000001cf71f13#) called at [vendor/magento/framework/App/Http.php:140]
#60 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#61 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:258]
#62 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000002f75ec30000000001cf71f13#) called at [index.php:39]
jmonrove commented 4 years ago

Occurs on EE 2.3.5-p1 as well

`1 exception(s): Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.

Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.

#1 Magento\CatalogStaging\Model\ResourceModel\Fulltext\Collection\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#2 Magento\CatalogStaging\Model\ResourceModel\Fulltext\Collection\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#3 Magento\CatalogStaging\Model\ResourceModel\Fulltext\Collection\Interceptor->___callPlugins() called at [generated/code/Magento/CatalogStaging/Model/ResourceModel/Fulltext/Collection/Interceptor.php:156]
#4 Magento\CatalogStaging\Model\ResourceModel\Fulltext\Collection\Interceptor->getFacetedData() called at [vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php:113]
#5 Magento\CatalogSearch\Model\Layer\Filter\Category->_getItemsData() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:202]
#6 Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:159]
#7 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:148]
#8 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItemsCount() called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:33]
#9 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->canShowOptions() called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:23]
#10 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->isEnabled() called at [vendor/magento/module-layered-navigation/Block/Navigation.php:126]
#11 Magento\LayeredNavigation\Block\Navigation->canShowBlock() called at [vendor/magento/module-layered-navigation-staging/Block/Navigation.php:51]
#12 Magento\LayeredNavigationStaging\Block\Navigation->canShowBlock() called at [app/design/frontend/theme/bps/Magento_LayeredNavigation/templates/layer/view.phtml:2]
#13 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#14 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#15 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#16 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#17 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:26]
#18 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:271]
#19 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:301]
#20 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1100]
#21 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1104]
#22 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:674]
#23 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:566]
#24 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:542]
#25 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#26 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#27 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#28 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:594]
#29 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:544]
#30 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#31 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#32 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#33 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:594]
#34 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:544]
#35 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#36 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#37 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#38 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:594]
#39 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:544]
#40 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#41 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#42 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#43 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:594]
#44 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:544]
#45 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#46 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#47 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#48 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:594]
#49 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:544]
#50 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#51 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#52 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#53 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:594]
#54 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:544]
#55 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#56 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:497]
#57 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#58 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:963]
#59 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#60 Magento\Framework\View\Layout\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#61 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#62 Magento\Framework\View\Layout\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:494]
#63 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]
#64 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#65 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#66 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#67 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#68 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130]
#69 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#70 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#71 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#72 Magento\Framework\App\Bootstrap->run() called at [index.php:39]`            
rahulbarot commented 4 years ago

I have this issue with 2.3.5-p2 and php 7.3

Georgian commented 3 years ago

Similar issue (my stacktrace is different) when doing fulltext search on 2.3.5-p1 with php 7.3.24, and no ElasticSearch.

Could it be because of a theme issue, or a rogue extension?

More details here: https://magento.stackexchange.com/questions/326998/fulltext-search-throws-the-bucket-doesnt-exist

Stack:

Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.
<pre>#1 Manadev\ProductCollection\Resources\Collections\FullTextProductCollection->getFacetedData('category') called at [generated/code/Manadev/ProductCollection/Resources/Collections/FullTextProductCollection/Interceptor.php:63]
#2 Manadev\ProductCollection\Resources\Collections\FullTextProductCollection\Interceptor->getFacetedData('category') called at [vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php:113]
#3 Magento\CatalogSearch\Model\Layer\Filter\Category->_getItemsData() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:202]
#4 Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:159]
#5 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:148]
#6 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItemsCount() called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:33]
#7 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->canShowOptions(array(&Magento\CatalogSearch\Model\Layer\Filter\Category#00000000261d0415000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041d000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0419000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041a000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0466000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0410000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0413000000006d43a070#)) called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:23]
#8 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->isEnabled(&Magento\Catalog\Model\Layer\Search#00000000261d0597000000006d43a070#, array(&Magento\CatalogSearch\Model\Layer\Filter\Category#00000000261d0415000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041d000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0419000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041a000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0466000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0410000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0413000000006d43a070#)) called at [vendor/magento/module-layered-navigation/Block/Navigation.php:126]
#9 Magento\LayeredNavigation\Block\Navigation->canShowBlock() called at [app/design/frontend/Infortis/base/Magento_LayeredNavigation/templates/layer/view.phtml:18]
Georgian commented 3 years ago

Found the solution myself. It was indeed a buggy extension (Manadev layered search). @rahulbarot @jmonrove @jimmybsilva @Zyles

Apologies for spamming this closed thread, hope it will help someone else.

alexvais commented 3 years ago

@Georgian did you find a solution?

Georgian commented 3 years ago

@alexvais Here -> https://magento.stackexchange.com/a/327010/92896

swallowli66 commented 3 years ago

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.

mcspronko commented 1 year ago

Still an issue with Magento 2.4.6-p1

ViditAttri commented 4 months ago

hello, I am facing this issue after i implemented a payment gateway on magento 2.4.6 and php 8.2 ,also if i disable the payment gateway module the error is resolved. Payment gateway is Stripe. 4.0.8 .

1 exception(s): Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.