PnP.Framework ApplyProvisioningTemplate sometimes fails
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at PnP.Framework.Utilities.RESTUtilities.ExecutePostAsync and ObjectSiteHeaderSettings.ProvisionObjects, using the Site Header failure and stack trace as the initial path. Compare successful and failed applications of the large template from the Azure Function context, and determine whether template size or the intermittent transport error is responsible. Done means the failure cause and a reproducible resolution are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100