I tried to upgrade my Magento 2.3.5 install to Magento 2.4.0, but am unable to get category pages to display products. Everything is in Docker, so I am using Elasticsearch 7.6 and have specified elasticsearch7
for catalog/search/engine
. The test from the Magento admin is successful. The category pages were working with 2.3.5 so I am assuming this is something related to the switch to Elasticsearch. I've looked at various upgrade guides without much luck as reindexing isn't fixing it for me.
The search works and returns products, as does loading a product detail page directly, and viewing the products in the Admin, however viewing any category page just shows:
We can't find products matching the selection.
Things I've tried:
Updated to Magento 2.4 using
composer
(via Docker) and then ranmagento setup:upgrade
and cleared cache.Verified that products are enabled, visible, in stock, have quantity, and are assigned to category
Disabled all non-Magento modules, deleted
./generated/code
,./var/view_preprocessed
, changed theme to Magento Blank.Cleared Cache / Reindexed
bash-5.0$ magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:01
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:05
bash-5.0$ magento cache:clean && magento cache:flush
Cleaned cache types:
config
layout
block_html
collections
reflection
db_ddl
compiled_config
eav
customer_notification
config_integration
config_integration_api
full_page
config_webservice
translate
Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
compiled_config
eav
customer_notification
config_integration
config_integration_api
full_page
config_webservice
translate
- Deleted Elasticsearch indices, reindexed, and checked using
curl
bash-5.0$ curl elasticsearch:9200/_cat/indices
bash-5.0$ curl elasticsearch:9200/
{
"name" : "18af19145c92",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "-95jfv_yQNqZWqXk1Z3nBg",
"version" : {
"number" : "7.6.2",
"build_flavor" : "oss",
"build_type" : "tar",
"build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
"build_date" : "2020-03-26T06:34:37.794943Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
bash-5.0$ magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:04
bash-5.0$ curl elasticsearch:9200/_cat/indices
yellow open magento2_product_1_v2 J4HvEAGeTFmxlovr5hl7zw 1 1 694 0 1.6mb 1.6mb
I noticed that there is no "category" index being created but not sure if there should be...
Enabled and disabled Flat Categories
Deleted and re-imported all Products
After deleting and re-importing the products I reindexed, cleared cache, regenerated thumbnails, etc. but still seeing the same behavior.
Edit - I deleted the database and reinstalled from scratch, imported products/categories, cleared cache, etc and the category pages are still not working. Can someone with a working install let me know how many indices are created in Elasticsearch? Can someone provide a same product import CSV that is working correctly for me to test?
_renderFiltersBefore()
and stepped through it, no exceptions there..$this->_filters
is empty as well. Nothing obvious going all the way through to the block.magento2_product_1_v50
. Do you use multi source inventory? I had all empty categories after playing with sources and assigning default website to none-default stock. Stores > Inventory > Stocks. Additionally, how about switching "Display Out of Stock Products: yes" temporarily? Stores > Configuration > Catalog > Inventory > Stock Options