10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.23k stars 312 forks source link

BUG: keep seeing odd errors in the ElasticPress Status Report #3914

Closed bfrye26 closed 2 months ago

bfrye26 commented 2 months ago

Describe the bug

Every few hours, we are seeing very strange errors in our ElasticPress Status Report page. It is listing things like the following screenshot. I am not sure what is causing them, but it is constant.

Steps to Reproduce

I am not sure the cause, it happens every day when we look at the site. it seems to be something to do with looking at itemid but I am not sure what the jtVVq is, so it is very strange.

Screenshots, screen recording, code snippet

image

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

bfrye26 commented 2 months ago

{ "from": 2870, "size": 14, "post_filter": { "bool": { "must": [ { "bool": { "must": [ { "terms": { "terms.category.slug": [ "articles" ] } } ] } }, { "bool": { "must": [ { "term": { "date_terms.m": "jtVVq" } } ] } }, { "terms": { "post_type.raw": [ "review", "post" ] } }, { "term": { "post_status": "publish" } } ] } }, "query": { "match_all": { "boost": 1 } }, "sort": [ { "post_date": { "order": "desc" } } ], "aggs": { "terms": { "filter": { "bool": { "must": [ { "bool": { "must": [ { "terms": { "terms.category.slug": [ "articles" ] } } ] } }, { "bool": { "must": [ { "term": { "date_terms.m": "jtVVq" } } ] } }, { "terms": { "post_type.raw": [ "review", "post" ] } }, { "term": { "post_status": "publish" } } ] } }, "aggs": { "category": { "terms": { "size": 10000, "field": "terms.category.slug" } }, "post_tag": { "terms": { "size": 10000, "field": "terms.post_tag.slug" } }, "archive-includes": { "terms": { "size": 10000, "field": "terms.archive-includes.slug" } }, "builder": { "terms": { "size": 10000, "field": "terms.builder.slug" } }, "esrb-rating": { "terms": { "size": 10000, "field": "terms.esrb-rating.slug" } }, "game-genre": { "terms": { "size": 10000, "field": "terms.game-genre.slug" } }, "game-platform": { "terms": { "size": 10000, "field": "terms.game-platform.slug" } }, "movie-genre": { "terms": { "size": 10000, "field": "terms.movie-genre.slug" } }, "review-type": { "terms": { "size": 10000, "field": "terms.review-type.slug" } }, "subsite": { "terms": { "size": 10000, "field": "terms.subsite.slug" } }, "template_tag": { "terms": { "size": 10000, "field": "terms.template_tag.slug" } }, "template_bundle": { "terms": { "size": 10000, "field": "terms.template_bundle.slug" } }, "post_type": { "terms": { "size": 10000, "field": "post_type.raw" } } } } } }

bfrye26 commented 2 months ago

{ "error": { "root_cause": [ { "type": "query_shard_exception", "reason": "failed to create query: For input string: \"jtVVq\"", "index_uuid": "7mjKuikyRt-yRR8026azFQ", "index": "cgmagonlinecom-post-1" } ], "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [ { "shard": 0, "index": "cgmagonlinecom-post-1", "node": "ztckf1FPSfifDHBaNkz20A", "reason": { "type": "query_shard_exception", "reason": "failed to create query: For input string: \"jtVVq\"", "index_uuid": "7mjKuikyRt-yRR8026azFQ", "index": "cgmagonlinecom-post-1", "caused_by": { "type": "number_format_exception", "reason": "For input string: \"jtVVq\"" } } } ] }, "status": 400 }

bfrye26 commented 2 months ago

Here are more from the error log, maybe it can be of use in tracking this down

burhandodhy commented 2 months ago

Hi @bfrye26,

After examining the error, it appears that when the site has a m in the query string, there is code that attempts to retrieve posts by year and month. Since Elasticsearch expects the value to be an integer and the code sends a string value, this results in an error.

To identify the cause of this issue, we recommend you install the Query Monitor plugin to trace the request. This will help you determine which part of the code is sending the incorrect request.

Since this is not an ElasticPress issue, and we do not provide support for third-party code, we will be closing this ticket. Let us know if you have any questions.

Regards, Burhan