Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PnP.Framework ApplyProvisioningTemplate sometimes fails #616

Open
mejohnm opened this issue Mar 3, 2022 · 5 comments
Open

PnP.Framework ApplyProvisioningTemplate sometimes fails #616

mejohnm opened this issue Mar 3, 2022 · 5 comments

Comments

@mejohnm
Copy link

mejohnm commented Mar 3, 2022

We are having a strange problem which sometimes fails when applying a large template in C# code in an Azure Function App.
The error is at the Site Header.

2022-03-03T15:48:49.543 [Information] ProvisioningAllNewJobs: 09/12 - Site Header
2022-03-03T15:49:08.536 [Error] Fehler in ProvisioningAllNewJobsSystem.Net.Http.HttpRequestException : An error occurred while sending the request. ---> System.IO.IOException : 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.. ---> System.Net.Sockets.SocketException : 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.End of inner exceptionat System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error,CancellationToken cancellationToken)at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)at async System.Net.Security.SslStream.g__InternalFillBufferAsync|215_0TReadAdapterat System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter,Memory1 buffer)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request,CancellationToken cancellationToken)End of inner exceptionat async System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection,HttpRequestMessage request,Boolean doRequestAuth,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request,Boolean doRequestAuth,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async PnP.Framework.Http.RetryHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask,HttpRequestMessage request,CancellationTokenSource cts,Boolean disposeCts)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async PnP.Framework.Utilities.RESTUtilities.ExecutePostAsync(Web web,String endpoint,String payload,String cultureLanguageName)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at PnP.Framework.Provisioning.ObjectHandlers.ObjectSiteHeaderSettings.ProvisionObjects(Web web,ProvisioningTemplate template,TokenParser parser,ProvisioningTemplateApplyingInformation applyingInformation)at PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web,ProvisioningTemplate template,ProvisioningTemplateApplyingInformation provisioningInfo,Boolean calledFromHierarchy,TokenParser tokenParser)at RCS.SharePoint.SharepointRepo.ApplyTemplate(String SiteUrl,ProvisioningTemplate template,ProvisioningTemplateApplyingInformation information) at E:\DBA\AzureApp\RCS.SharePoint\SharepointRepo.cs : 391at RCS.Provisioning.Repos.ProvisioningRepo.AssignTemplate(String ConcatenatedSitecollectionUri,ProvisioningParameters parameters) at E:\DBA\AzureApp\RCS.Provisioning\Repos\ProvisioningRepo.cs : 540at RCS.Provisioning.Repos.ProvisioningRepo.Provisioning(ProvisioningParameters parameters) at E:\DBA\AzureApp\RCS.Provisioning\Repos\ProvisioningRepo.cs : 135oningRepo.cs : 540at RCS.Provisioning.Repos.ProvisioningRepo.Provisioning(ProvisioningParameters parameters) at E:\DBA\AzureApp\RCS.Provisioning\Repos\ProvisioningRepo.cs : 135

Could this be happening because the template is too large? Again, it only happens sometimes.

@patrikhellgren
Copy link
Contributor

@mejohnm What version of PnP.Framework are you using? I would say that you are probably not using version 1.8.0 or later since there was additional retry handling for SocketExceptions implemented in #528 and 1.8.0 is the first release containing that (not counting nightly releases). This has nothing to do with the size of the template but with a larger template the number of calls increase and thereby also the risk for SocketExceptions.
See pnp/pnpcore#650 for more discussions regarding these issues.

@mejohnm
Copy link
Author

mejohnm commented Mar 3, 2022

@patrikhellgren Version 1.6.0

@patrikhellgren
Copy link
Contributor

@mejohnm Great, so if you upgrade to version 1.8.0 you will see the issue go away.

@mejohnm
Copy link
Author

mejohnm commented Mar 3, 2022

@patrikhellgren Have done so. I will give it a few days of testing and then write back here. Thank you for the quick reply. This is my first Azure function app and it was a huge project. So I truly appreciate the help.

@LockTar
Copy link

LockTar commented Mar 11, 2024

I think this should be closed by now???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants