Skip to content

Search configuration import timeout #8652

@Graph2133

Description

@Graph2133

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Developer environment

Windows

What browser(s) / client(s) have you tested

  • Chrome / CSOM client

Additional environment details

  • SharePoint tenant containing over hundread of SharePoint sites
  • .NET CSOM / pnp library used

Describe the bug / error

I am trying to configure SharePoint site using provisioning template and application token authentication. This template was working for almost a year and suddenly started to throw timeout error during configuration of search. I tried to import search configuration as a separate step using CSOM but I am getting the same timeout error. Setting of clientContext.RequestTimeout config setting to "infinite" number does not help.

The only way how I managed to make things work was through SearchConfigurationPortability object, I noticed that internally context.Load is timing out and we can not control timeout time there so I just threw that part away and everything worked.
The only problem is that import of search configuration takes much more time than previously.

SearchConfigurationPortability searchConfig = new SearchConfigurationPortability(context);
SearchObjectOwner owner = new SearchObjectOwner(context, searchObjectLevel);
searchConfig.ImportSearchConfiguration(owner, searchConfiguration);
context.Load(searchConfig); // This line loads warnings and is causing constant timeout
context.ExecuteQueryRetry();

I also noticed that page containing crawled and managed properties takes years to open , check:
<sharepoint_site_url>/_layouts/15/listmanagedproperties.aspx?level=site
<sharepoint_site_url>/_layouts/15/listcrawledproperties.aspx?level=sitecol

Steps to reproduce

  1. Configure 4-5 search result sources targeting SharePoint content type (let's say page).
  2. Configure couple of custom search mapped/managed properties.
  3. Export search configuration through CSOM.
  4. Try to import search configuration using CSOM :
var clientContext = new ClientContext(url);
clientContext.ExecutingWebRequest += (object sender, WebRequestEventArgs e) =>
{
  e.WebRequestExecutor.RequestHeaders.Add("Authorization", $"Bearer {token}");
};

clientContext.ImportSearchSettings(<path to exported search settings file>, SearchObjectLevel.SPSite);
clientContext.ExecuteQuery();

Expected behavior

The search configuration is successfully imported or meaningul error is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APItype:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions