0

We have some old timer jobs that have been developed some years ago, but we recently rewritten in an attempt to enhance the performance and prevent some issues like SharePoint Search encountered a problem and timeout issues following the guidelines here: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/pagination-for-large-result-sets

Our initial tests showed this was working great, but now we are starting to see the same pattern as previously where in some cases the timer jobs will fail with either SharePoint Search encountered a problem or a timeout exception.

Here's an example of the GetSearchResults method we use to retrieve the items using IndexDocId.

private ResultTable GetSearchResults(ClientContext cc, KeywordQuery keywordQuery, string startRow, string query, Guid sourceId, List<string> properties) { if (startRow == "0") { keywordQuery.QueryText = query; } else { keywordQuery.QueryText = $"IndexDocId>{startRow} AND ({query})"; } keywordQuery.TrimDuplicates = false; keywordQuery.EnableQueryRules = false; keywordQuery.SourceId = sourceId; keywordQuery.ClientType = "custom"; keywordQuery.EnableSorting = true; keywordQuery.SortList.Add("[DocId]", SortDirection.Ascending); //keywordQuery.SelectProperties.Add("AccountName"); //keywordQuery.SelectProperties.Add("LastName"); keywordQuery.SelectProperties.Add("IndexDocId"); foreach(var property in properties) { keywordQuery.SelectProperties.Add(property); } SearchExecutor searchExec = new SearchExecutor(cc); ClientResult<ResultTableCollection> results = searchExec.ExecuteQuery(keywordQuery); cc.ExecuteQueryRetry(); var resultTable = results.Value.FirstOrDefault(x => x.TableType == KnownTableTypes.RelevantResults); return resultTable; } 

Here's the stacktrace:

at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() at XXX.ClientContextExtensions.retry(Action func, Int32 retryCount, Int32 delay) in XXX\ClientContextExtensions.cs:line 278 at XXX.GetSearchResults(ClientContext cc, KeywordQuery keywordQuery, String startRow, String query, Guid sourceId, List`1 properties) in XXX\Managers\SearchManager.cs:line 586 

The error messages:

Search has encountered a problem that prevents results from being returned. If the issue persists, please contact your administrator.

Timeout

There's a retry pattern in place and if we get throttled this should get logged as warnings, but we don't see any. So, we are quite unsure what is going on - if it's us or it's Microsoft causing these issues?

1 Answer 1

1

Ensure you're not exceeding 25 requests per second, otherwise your application could get throttled:

Avoid getting throttled or blocked in SharePoint Online

If this doesn't help, you may need to contact Microsoft support. As stated in your question, the error returned should really be a 429 error if the problem had been caused by throttling. The error appears to be server side, so your only option would be to contact Microsoft support as they have access to more detailed logs.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.