3

I am provisioning web on SharePoint online using following CSOM code(provided hosted app), but intermediately we are getting "The request uses too many resources" error.

using (ClientContext clientContext = new ClientContext(url))
{


    WebCreationInformation webCreationInformation = new WebCreationInformation();
    webCreationInformation.Title = "Site 101";
    webCreationInformation.Description = "new site";
    webCreationInformation.Url = "Site101";
    webCreationInformation.WebTemplate = "BLANKINTERNETCONTAINER#0";
    webCreationInformation.UseSamePermissionsAsParentSite = ture;
    var newWeb = clientContext.Web.Webs.Add(webCreationInformation);
    clientContext.Load(newWeb);
    clientContext.ExecuteQuery();
}

Any idea what could be possible root cause, Our request doesn't have more than 2MB data, simple request to create subsite.

  • Are you creating site from custom site template? – Atish Dipongkor - MVP Aug 3 '16 at 12:36
  • There is a similar thread, without solution sharepoint.stackexchange.com/questions/141969/… Could you check with Fiddler, what is the ErrorMessage that the server sends in the response? Do you have the publishing feature activated on you site colletion? Do you have the same problem when creating a simple team site or if you create the Publishing site via the web UI? Could you check in the ULS log what errors got logged on the server side? You can increase the Trace level (up to VerboseEx) if you need more info in the logs. – pholpar Aug 3 '16 at 12:39
  • 1
    @AtishDipongkor: BLANKINTERNETCONTAINER#0 is a Publishing Portal, see funwithsharepoint.com/… – pholpar Aug 3 '16 at 12:41
  • ohh! I see. Have a look on my answer. – Atish Dipongkor - MVP Aug 3 '16 at 12:47
  • and unless if it is the root web of a site collection, you should use the CMSPUBLISHING#0 web template instead of BLANKINTERNETCONTAINER#0, as far as I see – pholpar Aug 3 '16 at 12:54
0

Try adding RequestTimeout in your code.

clientContext.RequestTimeout = 10 * 60 * 1000; 

References

  • Hi Atish, Thanks for your response, I've tried changes you mention but still getting same error intermediately. – Nikhil Patel Aug 4 '16 at 8:23
  • What happens when you create site using this template manually? – Atish Dipongkor - MVP Aug 4 '16 at 8:30
  • No error while creating site manually or via console app using same code – Nikhil Patel Aug 8 '16 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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