Search failed due to SearchPhaseExecutionException Will attempt again with new scroll – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.8-8.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when Elasticsearch encounters an issue during the search phase of a scroll operation. This could be due to a variety of reasons such as a timeout, memory issues, or a problem with the query. To resolve this, you could increase the timeout period, allocate more memory to Elasticsearch, or check the query for any errors. Additionally, ensure that the Elasticsearch cluster is healthy and not under heavy load. If the problem persists, consider breaking down the query into smaller parts or using pagination instead of scroll.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” [{}] search failed due to SearchPhaseExecutionException. Will attempt again with new scroll ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, search, scroll.

Log Context

Log “[{}] search failed due to SearchPhaseExecutionException. Will attempt again with new scroll” class name is ScrollDataExtractor.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 searchResponse = executeSearchScrollRequest(scrollId);
 } catch (SearchPhaseExecutionException searchExecutionException) {
 if (searchHasShardFailure) {
 throw searchExecutionException;
 }
 logger.debug("[{}] search failed due to SearchPhaseExecutionException. Will attempt again with new scroll"; context.jobId);
 markScrollAsErrored();
 searchResponse = executeSearchRequest(buildSearchRequest(lastTimestamp == null ? context.start : lastTimestamp));
 }
 logger.debug("[{}] Search response was obtained"; context.jobId);
 timingStatsReporter.reportSearchDuration(searchResponse.getTook());

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?