I am using Tenant.ApplyTenantTemplate() method to provision SharePoint sites. That process is taking long time and sometimes it fail because of temporary network failure.
The method will provision the template successfully and will handle the temporary network issues
An error occurred while sending the request. Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond..
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.SPWebRequestExecutor.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientRequest.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientRequest.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientRuntimeContext.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientContext.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientContextExtensions.
Use Tenant.ApplyTenantTemplate for huge template provisioning
Consider Network temporary issues in the ClientContextExtensions.ExecuteQueryImplementation, currently it is only handling the issue if there is a response otherwise it will fail without retry. Please check the line 161 in ClientContextExtensions.cs
Hi @mramadanahmed , today the PnP Framework (and PnP Sites Core as well) libraries are not retrying on network failure, we do handle throttling but when a network connection fails we're not automatically retrying the request. This might be something we can consider for the future in our new PnP Core SDK, but not something we can work on in the short term.
@jansenbe Thanks for the clarification. I already cloned the library and handled that on my side for now. I hope to see it very soon in the public version, may be as configuration parameter
So we can close this issue then?
So we can close this issue then?
Sure, thanks. Do you recommend posting that somewhere else to make sure it will be considered in the future?
Yes please post as a new issue or even better as a PR with your changes. This makes it easier for us to incorporate this later on. Closing this one for now.