Intermittent error pushing package

We’re getting an intermittent time-out pushing packages from VSTS to octopus server on a VM in azure. The server contains this in its log:

September 10th 2018 14:26:23
Error
Unhandled exception from web server processing POST to https://XXXXXX.australiaeast.cloudapp.azure.com/api/packages/raw?replace=False: Incorrect function System.Net.HttpListenerException at System.Net.HttpRequestStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize) at Nancy.IO.RequestStream.MoveStreamContentsToFileStream() at Nancy.IO.RequestStream.MoveStreamOutOfMemoryIfExpectedLengthExceedSwitchLength(Int64 expectedLength) at Nancy.IO.RequestStream…ctor(Stream stream, Int64 expectedLength, Int64 thresholdLength, Boolean disableStreamSwitching) at Octopus.Server.Web.OctopusNancyHost.ConvertRequestToNancyRequest(HttpListenerRequest request) at Octopus.Server.Web.OctopusNancyHost.Process(HttpListenerContext ctx) System.Net.HttpListenerException (0x80004005): Incorrect function at System.Net.HttpRequestStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize) at Nancy.IO.RequestStream.MoveStreamContentsToFileStream() at Nancy.IO.RequestStream.MoveStreamOutOfMemoryIfExpectedLengthExceedSwitchLength(Int64 expectedLength) at Nancy.IO.RequestStream…ctor(Stream stream, Int64 expectedLength, Int64 thresholdLength, Boolean disableStreamSwitching) at Octopus.Server.Web.OctopusNancyHost.ConvertRequestToNancyRequest(HttpListenerRequest request) at Octopus.Server.Web.OctopusNancyHost.Process(HttpListenerContext ctx)

September 10th 2018 14:26:23
Error
An exception was thrown disposing the HttpListenerContext.Response whilst dealing with an unhandled exception: An operation was attempted on a nonexistent network connection System.Net.HttpListenerException (0x80004005): An operation was attempted on a nonexistent network connection at System.Net.HttpResponseStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.Net.HttpListenerResponse.System.IDisposable.Dispose() at System.Net.HttpListenerResponse.Close() at Octopus.Server.Web.OctopusNancyHost.SafelyHandleProcessException(Exception e, HttpListenerContext httpListenerContext, NancyContext nancyContext)

Hi Simon,

Would you be able to provide details on which version of Octopus you are running and the file size of the package you are pushing? Based on the error I’m wondering if there’s a file size boundary causing differences in behavior.

Regards
Shannon

Hi Shannon,
Octopus v2018.4.11 running on a VM in azure on Server 2012 R2
Package is 40.6 MB (42,616,865 bytes)

I am able to upgrade if you think that will help.

And later on, a package succeeded that was 40.6 MB (42,616,909 bytes)

Hi Simon,

I did some reading about the threshold in Nancy around that call and it looks like the default size is way less than 40MB, so it would be hitting this code path frequently. I also turned up an old support ticket indicate this type of error has been around for a while.

It feels network related, but unfortunately I do not know what could be in between VSTS and your Octopus VM that could cause this.

Regards
Shannon

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.