Pnpframework: The SSL connection could not be established, see inner exception while provisioning pnp template

Created on 3 Jan 2021  路  5Comments  路  Source: pnp/pnpframework

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.

Expected behavior

The method will provision the template successfully and will handle the temporary network issues

Actual behavior

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..

Stack Trace:

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.d__19.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientRequest.d__53.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientRequest.d__39.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientRuntimeContext.d__57.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientContext.d__23.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SharePoint.Client.ClientContextExtensions.d__7.MoveNext()

Steps to reproduce behavior

Use Tenant.ApplyTenantTemplate for huge template provisioning

SharePoint Version

  • [x] PnP Framework for SharePoint Online

Suggestion for solution

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

question

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings