3
Magento ver. 2.4.2-p1
Amasty extensions

We used to have Elastic Search crash every once in a while but this is no longer happening since we upgraded to the most powerful server.

We had instances where couple of times a month, when you click on any category - the products would not load and it shows the following Error:

We can't find products matching the selection.

This now happens once a day.

Usually, running the following fixes the issue:

php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex

so I've set up cron jobs to run these every 2 hours or so but there is also an issue where running:

php bin/magento setup:di:compile

does not work (it gives an Error about some generated folder not being empty). When that happens, running it in this order seems to work:

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f

But this still leaves us with website downtime. The products on the front page load always but the issue appears for all products in all categories when it comes up.

I've googled this and tried running the following:

select * from mget_catalog_eav_attribute cea join mget_eav_attribute ea on ea.attribute_id = cea.attribute_id and backend_type in ('text', 'varchar') where cea.is_filterable = 1;

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0007 seconds.)

update mget_catalog_eav_attribute cea 
join mget_eav_attribute ea
  on ea.attribute_id = cea.attribute_id 
  and backend_type in ('text', 'varchar')
set cea.is_filterable = 0
where 
  cea.is_filterable = 1

0 rows affected. (Query took 0.0008 seconds.)

How can I narrow down where the problem is coming from and how to fix it permanently?

BTW - this is the Error that sometimes comes up when running:

php bin/magento setup:di:compile 

The directory "/home/MYWEBSITE/public_html/generated/code/Magento/Framework" cannot be deleted Warning!rmdir(/home/MYWEBSITE/public_html/generated/code/Magento/Framework): Directory not empty

UPDATED on April 15th at 20:32 MST: It just happened again and just running re-index ( php bin/magento indexer:reindex ) has made it work (to load the products in categories). I pulled the log files and here is the recent content:

debug.log:

[2023-04-16T02:04:26.262557+00:00] main.INFO: Broken reference: the 'product_view_custom_block' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:04:26.262844+00:00] main.INFO: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and 'porto_header' respectively. [] []
[2023-04-16T02:04:26.262986+00:00] main.INFO: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links' and 'header.panel' respectively. [] []
[2023-04-16T02:04:26.263171+00:00] main.INFO: Broken reference: the 'sw.sidenav' tries to reorder itself towards 'category_leftnav', but their parents are different: 'sidebar.main' and '' respectively. [] []
[2023-04-16T02:04:26.263270+00:00] main.INFO: Broken reference: the 'sidebar_second_block' tries to reorder itself towards '', but their parents are different: 'sidebar.second' and '' respectively. [] []
[2023-04-16T02:04:26.263454+00:00] main.INFO: Broken reference: the 'skip_gallery_before' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_before.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:04:26.263562+00:00] main.INFO: Broken reference: the 'skip_gallery_after' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_after.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:04:26.263722+00:00] main.INFO: Broken reference: the 'product_view_custom_block' tries to reorder itself towards '', but their parents are different: 'sidebar.additional' and '' respectively. [] []
[2023-04-16T02:04:26.264150+00:00] main.WARNING: Broken reference: The element with the "sidebar.additional" ID wasn't found. Verify the ID and try again. [] []
[2023-04-16T02:14:22.931273+00:00] main.INFO: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.931788+00:00] main.INFO: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932083+00:00] main.INFO: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932279+00:00] main.INFO: Broken reference: the 'sw.sidenav' element cannot be added as child to 'sidebar.main', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932386+00:00] main.INFO: Broken reference: the 'sidebar_second_block' element cannot be added as child to 'sidebar.second', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932982+00:00] main.INFO: Broken reference: the 'product_view_custom_block' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.933254+00:00] main.INFO: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and 'porto_header' respectively. [] []
[2023-04-16T02:14:22.933417+00:00] main.INFO: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links' and 'header.panel' respectively. [] []
[2023-04-16T02:14:22.933612+00:00] main.INFO: Broken reference: the 'sw.sidenav' tries to reorder itself towards 'category_leftnav', but their parents are different: 'sidebar.main' and '' respectively. [] []
[2023-04-16T02:14:22.933704+00:00] main.INFO: Broken reference: the 'sidebar_second_block' tries to reorder itself towards '', but their parents are different: 'sidebar.second' and '' respectively. [] []
[2023-04-16T02:14:22.933864+00:00] main.INFO: Broken reference: the 'skip_gallery_before' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_before.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:14:22.934010+00:00] main.INFO: Broken reference: the 'skip_gallery_after' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_after.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:14:22.934187+00:00] main.INFO: Broken reference: the 'product_view_custom_block' tries to reorder itself towards '', but their parents are different: 'sidebar.additional' and '' respectively. [] []
[2023-04-16T02:14:22.934592+00:00] main.WARNING: Broken reference: The element with the "sidebar.additional" ID wasn't found. Verify the ID and try again. [] []

system.log:

[2023-04-16T01:58:48.711458+00:00] main.WARNING: Broken reference: The element with the "sidebar.additional" ID wasn't found. Verify the ID and try again. [] []
[2023-04-16T02:04:26.260952+00:00] main.INFO: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:04:26.261397+00:00] main.INFO: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:04:26.261686+00:00] main.INFO: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:04:26.261880+00:00] main.INFO: Broken reference: the 'sw.sidenav' element cannot be added as child to 'sidebar.main', because the latter doesn't exist [] []
[2023-04-16T02:04:26.261979+00:00] main.INFO: Broken reference: the 'sidebar_second_block' element cannot be added as child to 'sidebar.second', because the latter doesn't exist [] []
[2023-04-16T02:04:26.262557+00:00] main.INFO: Broken reference: the 'product_view_custom_block' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:04:26.262844+00:00] main.INFO: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and 'porto_header' respectively. [] []
[2023-04-16T02:04:26.262986+00:00] main.INFO: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links' and 'header.panel' respectively. [] []
[2023-04-16T02:04:26.263171+00:00] main.INFO: Broken reference: the 'sw.sidenav' tries to reorder itself towards 'category_leftnav', but their parents are different: 'sidebar.main' and '' respectively. [] []
[2023-04-16T02:04:26.263270+00:00] main.INFO: Broken reference: the 'sidebar_second_block' tries to reorder itself towards '', but their parents are different: 'sidebar.second' and '' respectively. [] []
[2023-04-16T02:04:26.263454+00:00] main.INFO: Broken reference: the 'skip_gallery_before' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_before.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:04:26.263562+00:00] main.INFO: Broken reference: the 'skip_gallery_after' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_after.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:04:26.263722+00:00] main.INFO: Broken reference: the 'product_view_custom_block' tries to reorder itself towards '', but their parents are different: 'sidebar.additional' and '' respectively. [] []
[2023-04-16T02:04:26.264150+00:00] main.WARNING: Broken reference: The element with the "sidebar.additional" ID wasn't found. Verify the ID and try again. [] []
[2023-04-16T02:14:22.931273+00:00] main.INFO: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.931788+00:00] main.INFO: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932083+00:00] main.INFO: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932279+00:00] main.INFO: Broken reference: the 'sw.sidenav' element cannot be added as child to 'sidebar.main', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932386+00:00] main.INFO: Broken reference: the 'sidebar_second_block' element cannot be added as child to 'sidebar.second', because the latter doesn't exist [] []
[2023-04-16T02:14:22.932982+00:00] main.INFO: Broken reference: the 'product_view_custom_block' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2023-04-16T02:14:22.933254+00:00] main.INFO: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and 'porto_header' respectively. [] []
[2023-04-16T02:14:22.933417+00:00] main.INFO: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links' and 'header.panel' respectively. [] []
[2023-04-16T02:14:22.933612+00:00] main.INFO: Broken reference: the 'sw.sidenav' tries to reorder itself towards 'category_leftnav', but their parents are different: 'sidebar.main' and '' respectively. [] []
[2023-04-16T02:14:22.933704+00:00] main.INFO: Broken reference: the 'sidebar_second_block' tries to reorder itself towards '', but their parents are different: 'sidebar.second' and '' respectively. [] []
[2023-04-16T02:14:22.933864+00:00] main.INFO: Broken reference: the 'skip_gallery_before' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_before.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:14:22.934010+00:00] main.INFO: Broken reference: the 'skip_gallery_after' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_after.wrapper' and 'product.info.media' respectively. [] []
[2023-04-16T02:14:22.934187+00:00] main.INFO: Broken reference: the 'product_view_custom_block' tries to reorder itself towards '', but their parents are different: 'sidebar.additional' and '' respectively. [] []
[2023-04-16T02:14:22.934592+00:00] main.WARNING: Broken reference: The element with the "sidebar.additional" ID wasn't found. Verify the ID and try again. [] []


So it turns out I've been checking the log files for the wrong website!

I have an old (current production) site - let's call it WEBSITE-OLD. This is Magento ver. 2.4.2-p1.

Because of various problems with WEBSITE-OLD, I am setting up WEBSITE-NEW. I have exported the products out of this WEBSITE-OLD and imported them into WEBSITE-NEW which is Magento ver. 2.4.5-p1 via:

- System - Data Transfer - Export/Import

Now I can't check the log files on WEBSITE-OLD because of the size:

debug.log = 5.04 GB system.log = 4.30 GB

(I don't think I will be able to open files of this size)

So my plan is to delete both debug.log and system.log and let them re-create, then wait for the problem to appear and retrieve the information from the log files.

The interesting part is this:

  • I've gone into a random category on WEBSITE-NEW and the products loaded as expected. I have then clicked on the drop-down to display 36 products and then, when the website was trying to load them, it gave the same Error instead (and this is a different Magento installation just the products are the same):

We can't find products matching the selection.

This is a huge problem for me because I am setting up WEBSITE-NEW precisly for the reason to get away from all the problems we've had (and still are having) on WEBSITE-OLD!

This are last few lines from EXCEPTION.LOG on WEBSITE-OLD:

main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [position_category_165] in order to sort on","index_uuid":"28MvSM-OQQiKdIzGbAF6pw","index":"magento2_product_2_v729"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_2_v729","node":"XhwuvdhtRH6fh3djNV8f9A","reason":{"type":"query_shard_exception","reason":"No mapping found for [position_category_165] in order to sort on","index_uuid":"28MvSM-OQQiKdIzGbAF6pw","index":"magento2_product_2_v729"}}]},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [position_category_165] in order to sort on\",\"index_uuid\":\"28MvSM-OQQiKdIzGbAF6pw\",\"index\":\"magento2_product_2_v729\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_2_v729\",\"node\":\"XhwuvdhtRH6fh3djNV8f9A\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [position_category_165] in order to sort on\",\"index_uuid\":\"28MvSM-OQQiKdIzGbAF6pw\",\"index\":\"magento2_product_2_v729\"}}]},\"status\":400} at /home/denvergardenpros/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []
[2023-04-18 02:47:56] main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [position_category_193] in order to sort on","index_uuid":"28MvSM-OQQiKdIzGbAF6pw","index":"magento2_product_2_v729"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_2_v729","node":"XhwuvdhtRH6fh3djNV8f9A","reason":{"type":"query_shard_exception","reason":"No mapping found for [position_category_193] in order to sort on","index_uuid":"28MvSM-OQQiKdIzGbAF6pw","index":"magento2_product_2_v729"}}]},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [position_category_193] in order to sort on\",\"index_uuid\":\"28MvSM-OQQiKdIzGbAF6pw\",\"index\":\"magento2_product_2_v729\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_2_v729\",\"node\":\"XhwuvdhtRH6fh3djNV8f9A\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [position_category_193] in order to sort on\",\"index_uuid\":\"28MvSM-OQQiKdIzGbAF6pw\",\"index\":\"magento2_product_2_v729\"}}]},\"status\":400} at /home/denvergardenpros/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []
[2023-04-18 02:51:31] main.CRITICAL: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v752","node":"XhwuvdhtRH6fh3djNV8f9A","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_1_v752\",\"node\":\"XhwuvdhtRH6fh3djNV8f9A\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}},\"status\":400} at /home/denvergardenpros/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []
[2023-04-18 02:51:50] main.CRITICAL: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v752","node":"XhwuvdhtRH6fh3djNV8f9A","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_1_v752\",\"node\":\"XhwuvdhtRH6fh3djNV8f9A\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}},\"status\":400} at /home/denvergardenpros/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []
[2023-04-18 02:51:57] main.CRITICAL: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v752","node":"XhwuvdhtRH6fh3djNV8f9A","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_1_v752\",\"node\":\"XhwuvdhtRH6fh3djNV8f9A\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}},\"status\":400} at /home/denvergardenpros/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []
[2023-04-18 02:55:06] main.CRITICAL: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_2_v729","node":"XhwuvdhtRH6fh3djNV8f9A","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [featured_value]"}}},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"magento2_product_2_v729\",\"node\":\"XhwuvdhtRH6fh3djNV8f9A\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"no mapping found for field [featured_value]\"}}},\"status\":400} at /home/denvergardenpros/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []



UPDATED on May 12th, 2023.

Magento 2.4.5-p1
Smartwave Porto theme
There is no NginX running on my hosting server

This is also happening on the new Magento 2.4.5-p1 website I'm building.

There are 4 problems:

1. Products in categories will load for a while and then (in less than half an hour) - when you click on a Category, it will just say the following and NOT load any products:

We can't find products matching the selection.

It has just happened now, I have gone through all of the categories and it appears only 4 categories load products as expected and 25 categories do not.

When this happens, deleting Cache, re-indexing and the following commands (at times) must be run in order to bring the products back:

php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex

2. Just clicking through on the Categories sometimes goes into a blank page for a little while which shows the following Error:

This site can’t be reached

The web page at https://EXAMPLE.com/new/admin/cache/massRefresh/ might be temporarily down or it may have moved permanently to a new web address.
ERR_HTTP2_PROTOCOL_ERROR

This stays on for a few seconds and then (without me doing anything) loads the page as expected.

3. Searching does not work even-though Elasticsearch is up and running and we are running Elasticsearch 7.10.2.

4. When saving a category after making a change, the system will sometimes give the following Error:

Attention

Something went wrong.

A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

While on the second try to save, it will save.

So the only common thing to both my old Magento 2.4.2-p1 site and the new Magento 2.4.5-p1 site I'm building are the products which were moved over via the Export/Import tool in the Admin panel. My colleague has put the products in manually and it is very likely that he put in spaces in places where they do not belong and illegal characters. I am willing to go through all the products manually and check/correct this if it is likely causing the problem. What specifically would I be looking for? What is NOT allowed and which characters where could be causing this type of an issue?

Here is my debug.log:

https://codepen.io/Allysin/pen/bGmKMag

Here is my system.log:

https://codepen.io/Allysin/pen/OJBEZZR


UPDATED on May 17th, 2023:

Here is the result of:

 "curl localhost:9200/_cat/indices"

yellow open magento242_product_2_v3 3ZbW-3DNQKKgJCf9sVPUKA 1 1 1426 0 2.8mb 2.8mb
yellow open magento242_product_1_v3 57soJCbEQOiyHPg8IgMs2g 1 1 1238 0 1.7mb 1.7mb
yellow open magento2_product_7_v2327 jDcWA1grQWqywd3Bk9nj3Q 1 1 953 0 1.1mb 1.1mb
yellow open magento2_product_4_v2553 aDP2Qg2XRRO_tbEtNXNTHA 1 1 133 0 133.6kb 133.6kb
yellow open magento2_product_1_v2584 XPKMX3z7R9u3v_YfRd7z1g 1 1 1238 0 1.7mb 1.7mb
yellow open magento2_product_3_v2557 _RKvvPYXQminE94uV17Asg 1 1 996 0 2.1mb 2.1mb
yellow open magento2_product_5_v573 x9VuHClhTjO8ZiB3Bhe5YA 1 1 133 0 123.8kb 123.8kb
yellow open magento2_product_8_v215 TkhDhKcOSLaid7YD5_182A 1 1 2048 1 3.4mb 3.4mb
yellow open magento242_product_7_v3 p-NXTQqcRl2bz7pBC0fVfw 1 1 953 0 1.1mb 1.1mb
yellow open magento2_product_2_v2561 OYnOtLBuQiOzVLmaoz9MRw 1 1 1426 0 2.8mb 2.8mb
yellow open magento2_product_6_v432 QvDDCpARS2SZ2DA_nvKjcw 1 1 0 0 208b 208b
yellow open magento242_product_3_v3 0zNj2ec9Sz6pVwZSFtGRhw 1 1 996 0 2mb 2mb
yellow open magento242_product_4_v3 aUTsIo8FRDuH_vwgfSKrCQ 1 1 133 0 133.5kb 133.5kb



UPDATED on May 19th, 2023:

So I spoke too soon! (I thought the problem was resolved but it is not).

I have a total of 40 categories on the front page. Out of these:

  • 32 were loading products as expected

and

  • 8 specific ones were not

I ran:

php bin/magento indexer:reindex

and it did NOT solve the problem.

I then ran:

php bin/magento setup:di:compile 

and this brought all the products back into the 8 categories which were missing them!

I do NOT have:

/var/log/elasticsearch/elasticsearch.log and /var/log/elasticsearch/gc.log

as Vivek Kumar suggested (to check).

What else can I try to do please?

7
  • Allysin, When this was happening once a day, do you have a log of EXACTLY date/time when this event happened? We might be able to associate some activity if we know the exact date and time. And you could turn on your GENERAL LOG, 15 seconds before the expected problem to get an idea of WHAT was happening when the problem rears it's ugly head. Turning OFF the general log at 30 seconds later HAS to be accomplished to avoid filling your media with unnecessary General Log details. View profile for contact info, please. Apr 14 at 20:03
  • @Wilson Hauck Thank you for your suggestions -they are much appreciated! The problem is that this happens at random times so there is no way to tell ahead of time. The interesting part is that I witnessed the issue when it was already happening today (about 3 hours ago) & I waited for all the commands I've put into the cron to run but it still did not fix the problem! I had to run them several times manually via Putty and then the website finally started loading products. I also found 2 categories (only) where 1 loaded 1 product and the other 3 (out of many). Would any of the other logs help?
    – Allysin
    Apr 14 at 20:16
  • last 400 lines of your error log could be helpful. Apr 15 at 19:45
  • @Wilson Hauck Thank you for trying to help. I just caught it happening and so I pulled the log files and listed the last few lines from the log files up in my original post if you would take a look please?
    – Allysin
    Apr 16 at 2:39
  • Your recent details lead me to suspect that something is causing indexes to become corrupted - UPDATED on April 15th at 20:32 MST: It just happened again and JUST running re-index ( php bin/magento indexer:reindex ) has made it work (to load the products in categories). We just need to find out why, please. Your most likely source of information may be your error log from 2023-04-16T01:30 AM to 02:30 AM. Not just part of it, every complete line for this one hour of error log, please. View profile for contact info. Apr 16 at 12:33

3 Answers 3

1
+50

Please check if you are running multiple versions of elasticsearch on the same server and same port. If it is the case, please confirm that each instance is using a different prefix for elasticsearch indices.

EDIT

Go to STORES > CONFIGURATION > CATALOG > CATALOG > CATALOG SEARCH > Elasticsearch Index Prefix and check that you have different prefix for each of the Magento instances installed on the server.

11
  • Thank you for your post. I've raised this with my hosting & they said the following: "I do not think it is possible to run 2 instances of Elasticsearch on the same server, I can see a single service running and a single process for the service. The port 9200 is used by one process. Note that if you need a more in depth customizing of the service we would not be able to help since it is a third party service we are not familiar with to that extent. We can install it and perform the initial setup to get it started, but more deeper customizations need to be performed by certified..."
    – Allysin
    May 17 at 11:56
  • Please check the edit May 17 at 12:03
  • Thank you. I have 2 Magento instances on 1 server = Magento 2.4.2-p1 and Magento 2.4.5-p1. I checked in the Magento Admin panel in both and both Elasticsearch Index Prefix show THE SAME = magento2. Should I change one of those to something else? And if so, what should I put in instead of 'magento2'? Thanks.
    – Allysin
    May 17 at 12:15
  • yes, please change the indices so that the indices on each instance is unique. It really doesn't matter what it is. May 17 at 12:55
  • Also, please add result of "curl localhost:9200/_cat/indices" in your questions so people can see how the indices are being built in your elasticsearch. May 17 at 12:57
0

Recently has same issue, caused by an attribute that is numeric or text but in elastic search is opposite. caused by admin change or bad configuration:

1.- Check if you has this section ,that has an index attribute configuration in a section called 'Search Management-> Search Indexes', check wich attributeis 'numeric' o 'text' because this cause conflict with elastic search. in this case :

enter image description here

Check all indexes status (green).

enter image description here Remove in this section attributes , and set search weight enter image description here

2.- Search all Attributes used to listing or sort , only attributes that use elastic search

how to configure Attribute to add listing

Used in Product Listing: Set to Yes to include in product listings( Elastic search attribute).

Used for Sorting in Product Listing: Set to Yes to use as a sort parameter for product listings. (Elastic search attribute)

how to indixes elastic search show attribute map type

enter image description here

3.- Verify Attribute 'Input For Store Owner Validation' in 'none' (reset default state) , this map -elastic search issue when restart elastic search

enter image description here

4.- Restore if is necessary Attribute EAV attribute code

select * from eav_attribute where attribute_code = 'mst_search_weight';

backend type : varchar and content_type : text

content_type = map type

enter image description here

5.- Restart Elastic search or clear/delete indexes

In this section (Store -> Configuration-> Miravist Extensions Search Ultimate) enter image description here

Check Status and Delete all enter image description here

list index delete index

I hope this can help you.

7
  • Thank you for your answer. I will be honest, I don't understand the steps though. Should I install a Miravist module? Would that help? Are you saying to go into: STORES -> ATTRIBUTES --> PRODUCT where I have 51 attributes listed and disable all except the ones that are absolutely necessary by going into STOREFRONT PROPERTIES and setting everything to NO?
    – Allysin
    May 12 at 20:13
  • Where is #2? Would you please add the exact steps to your post? Thank you so much.
    – Allysin
    May 12 at 20:16
  • First you need restore 'elastic search' in magento, after add attributes , and check wich is that cause conflict with elastic search
    – Adrian R
    May 12 at 21:50
  • Only disable attributes in configuration Index in 'Search Indexes' section
    – Adrian R
    May 12 at 21:52
  • Or only check if attributes in steep 4 and search all attributes has right configuration, and match with elastic search elastic.co/guide/en/elasticsearch/reference/7.17/…
    – Adrian R
    May 12 at 21:56
0

Just trying to help please forgive me if this solution is irrelevant to the topic

But if you are facing issue with product not display on search or category page randomly

There is a Patch for same = ACSD-51114

Please look into it might resolve your issue

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.