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

ERROR: The remote host closed the connection. The error code is 0x800704CD. (System.Web.HttpException) #387

Closed
akuryan opened this issue Jul 1, 2020 · 4 comments

Comments

@akuryan
Copy link
Contributor

akuryan commented Jul 1, 2020

Do you want to request a feature or report a bug?
It is a bug
What is the current behavior?
When I try to sync Unicorn with some long running operation (I observed a project being synced for 500000 ms) via Unicorn.psm1 script - it generates an error

5800 12:33:30 ERROR ERROR: The remote host closed the connection. The error code is 0x800704CD. (System.Web.HttpException)
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
   at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
   at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
   at System.Web.HttpWriter.Write(String s)
   at System.Web.HttpResponseWrapper.Write(String s)
   at Kamsar.WebConsole.TextWebConsole.Write(String statusMessage, MessageType type, Object[] formatParameters)
   at Unicorn.Logging.PubSubLogger.Flush()
   at Unicorn.Pipelines.UnicornSyncComplete.SyncCompleteLogger.Process(UnicornSyncCompletePipelineArgs args)
   at (Object , Object )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Unicorn.SerializationHelper.RunUnicornSyncComplete(IConfiguration configuration, DateTime syncStartTimestamp)
   at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, Boolean runSyncStartPipeline, IItemData partialSyncRoot)
   at Unicorn.SerializationHelper.SyncConfigurations(IConfiguration[] configurations, IProgressStatus progress, ILogger additionalLogger)

When running sync in browser - it is not reproducing

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
Is there a way to continue sync in background if Stream could not be read and get sync status via API call?

Please mention your Sitecore version and Unicorn version.
Unicorn version is 4.1.1
Sitecore versin 9.1.0
This issue is reproduced stably when running in geo-replicated master and core databases in failover group with Active-Passive

@akuryan
Copy link
Contributor Author

akuryan commented Jul 1, 2020

I tried to hide this problem by increasing timeout in script:

	$responseStreamReader = new-object System.IO.StreamReader $responseStream
	$responseStreamReader.BaseStream.ReadTimeout = 10800000
	$responseStreamReader.BaseStream.WriteTimeout = 10800000

But, this does not helped.

One more thing - sometimes when this timeout is recorder - my web app is restarted as well :(

@akuryan
Copy link
Contributor Author

akuryan commented Jul 1, 2020

One more thing - same error could be reproduced when running Sync-Unicorn directly on azure webapp SCM (so, it is not related to internet connection quality or some other drops)

@akuryan
Copy link
Contributor Author

akuryan commented Jul 12, 2020

Also, I see these kind of errors thrown, which terminates my ASP.NET process completely:

ERROR Unhandled exception detected. The ASP.NET worker process will be terminated. 
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: System.Web
   at System.Web.HttpWriter.BufferData(Byte[] data, Int32 offset, Int32 size, Boolean needToCopyData)
   at System.Web.HttpWriter.FlushCharBuffer(Boolean flushEncoder)
   at System.Web.HttpWriter.GetBufferedLength()
   at System.Web.HttpResponse.UpdateNativeResponse(Boolean sendHeaders)
   at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
   at System.Web.HttpWriter.Write(String s)
   at System.Web.HttpResponseWrapper.Write(String s)
   at Kamsar.WebConsole.TextWebConsole.Write(String statusMessage, MessageType type, Object[] formatParameters)
   at Kamsar.WebConsole.WebConsole.<.ctor>b__8_0(Object arg)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()

@cassidydotdk
Copy link
Member

Fixed in #390

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

2 participants