question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Steps to reproduce behavior

Use Tenant.ApplyTenantTemplate for huge template provisioning

SharePoint Version

  • 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jansenbecommented, Jan 5, 2021

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.

1reaction
mramadanahmedcommented, Jan 4, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

The SSL connection could not be established, see inner ...
Hi, NeidennX-8393. Please make sure the server's certificate is valid. And try using HttpClient, and use AndroidClientHandler class to create ...
Read more >
How to fix "The SSL connection could not be established ...
I want to download osu! avatars to use them, but keep getting this error: The SSL connection could not be established. Inner exception...
Read more >
How to Connect to SharePoint Online using PnP ...
Learn how to connect to SharePoint Online from PnP PowerShell with this comprehensive guide. Follow our easy steps for all the information ...
Read more >
Error when using Get-PnPProvisioningTemplate. ...
Now I get an error: File Not Found during export template to pnp file. Any idea why? Connect-PnPOnline -PnPManagementShell -Url https://XXX ...
Read more >
Invoke-PnPSiteTemplate | PnP PowerShell
Applies a site template in XML format to the current web. It will populate the parameter in the template the values as specified...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found