Forum Discussion
SharePoint Online issues creating site collections via PnP code again...
Thank you for your response.
I am not using the provisioning engine, just a simple csom call to create a blank team site. There are no other requests to this site during this time.
For me this is clearly a bug in SPO or something changed and the PnP extension needs an update. But since there are probably many others, using this PnP extension, i was wondering if other people have also seen this and maybe opend support cases already and can provide some more information on this topic.
So the way I understand this, there is nothing I can do about it from my code perspective.
I am facing the same issue. In my case, I am using Azure webjob to create the site. This error happens before applying the template.
Here is the stack trace:
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay)
at Microsoft.SharePoint.Client.TenantExtensions.GetSiteGuidByUrl(Tenant tenant, Uri siteFullUrl)
at Microsoft.SharePoint.Client.TenantExtensions.CreateSiteCollection(Tenant tenant, SiteEntity properties, Boolean removeFromRecycleBin, Boolean wait)
- Oliver ZeiserOct 19, 2016Brass Contributor
Yup that is the same issue. I am seeing this at more than 15 customers. But many others are just working fine. And I have the same code running there. So I guess only a few tenants/sharepoint online farms have this issue.
It is a big pain that the key feature of sharepoint online, creating sitecollections, is not working reliable. I am still not quite sure if the issue only shows up with PnP library or also using ootb csom methods. I guess i'll have to check that first before opening one more support case....
- Tero ArvolaJan 16, 2017Copper Contributor
I'm experiencing the same behaviour in at least three tenants (haven't tested more at this point). I'm not using PnP extension methods for creation. The issue seems to come more often when creating multiple site collections in a row, using Azure continuous webjob.
- Oliver ZeiserJan 17, 2017Brass Contributor
Wer are also still seeing this on many tenants. MS doesn't seem to care though. I guess they are busy figuring out new ways on how to prevent or break customizations ;)
Just build your own retry logic. You will be better off trying to fix it yourself than hoping for MS to fix it. Since it is related to code, support tickets won't help you.
- Oliver ZeiserOct 26, 2016Brass Contributor
So here is a quick update: The issue still persists on many tenants, so let me provide some more info on this issue.
The problem is, that the SpoOperation returns IsComplete even if the site is not really provisioned. Even worse, when getting the site status via Tenant.GetSitePropertiesByUrl it will report "Active" although the real status is still "Creating". This is why the PnP CreateSite method fails when trying to get the site guid, since this one still does not exist.
Only workaround I have found so far is to wait in a back-off try-catch loop for the site to be really provisioned.
Its a big pain since this basic feature in SPO shoud just work...., but maybe this helps someone....
- Venkata Ratnam VemulaFeb 08, 2017Brass Contributor
Hi Oliver,
Could you please share the workaround logic (Source code)