Timeout when pushing to Octopus Deploy Server using OctoPack

We are using AppVeyor to build the a solution that is using OctoPack to push the build NuGet-package to our Octopus Deploy Server but it fails with a timeout. We have tried to add a Timeout parameter without any success.

From build log:
OctoPack: OctoPack successful
Pushing XXX.1.0.25.nupkg to ‘http://octopus.XXX.se/nuget/packages’…
PUT http://octopus.XXX.se/nuget/packages/
An error was encountered when fetching ‘PUT http://octopus.XXX.se/nuget/packages/’. The request will now be retried.
The HTTP request to ‘PUT http://octopus.XXX.se/nuget/packages/’ has timed out after 100000ms.
PUT http://octopus.XXX.se/nuget/packages/
An error was encountered when fetching ‘PUT http://octopus.XXX.se/nuget/packages/’. The request will now be retried.
The HTTP request to ‘PUT http://octopus.XXX.se/nuget/packages/’ has timed out after 100000ms.
PUT http://octopus.XXX.se/nuget/packages/
The HTTP request to ‘PUT http://octopus.XXX.se/nuget/packages/’ has timed out after 100000ms.
C:\projects\XXX\src\packages\OctoPack.3.4.2\tools\OctoPack.targets(108,5): error MSB3073: The command ““C:\projects\XXX\src\packages\OctoPack.3.4.2\tools\NuGet.exe” push “C:\projects\XXX\src\XXX\obj\octopacked\XXX.1.0.25.nupkg” API-XXXXX -Source http://octopus.XXX.se/nuget/packages -Timeout 501” exited with code 1. [C:\projects\XXX\src\XXX\XXX.csproj]

At the same time we see the following errors on our Octopus Deploy server repeated three times with two minutes interval:
2016-11-24 15:15:05 Error
Unhandled exception from web server: One or more errors occurred.
System.Net.HttpListenerException (0x80004005): Incorrect function
at System.Net.HttpRequestStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at Nancy.Extensions.StreamExtensions.<>c__DisplayClass3.b__2(IAsyncResult writeResult)
2016-11-24 15:15:05 Error
Unhandled exception from web server: The parameter is incorrect
System.Net.HttpListenerException (0x80004005): The parameter is incorrect
at System.Net.HttpResponseStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.Net.HttpListenerResponse.Dispose(Boolean disposing)
at System.Net.HttpListenerResponse.System.IDisposable.Dispose()
at System.Net.HttpListenerResponse.Close()
at Octopus.Server.Web.OctopusNancyHost.HandleProcessException(Exception e, HttpListenerContext ctx, NancyContext context) in C:\buildagent\work\cd33152532ae115f\source\Octopus.Server\Web\OctopusNancyHost.cs:line 465
at Octopus.Server.Web.OctopusNancyHost.Process(HttpListenerContext ctx) in C:\buildagent\work\cd33152532ae115f\source\Octopus.Server\Web\OctopusNancyHost.cs:line 454
at Octopus.Server.Web.OctopusNancyHost.GotCallback(IAsyncResult ar) in C:\buildagent\work\cd33152532ae115f\source\Octopus.Server\Web\OctopusNancyHost.cs:line 420

System Information
Octopus.Version: 3.5.2
System.OSVersion: Microsoft Windows NT 6.2.9200.0
System.ClrVersion: 4.0.30319.42000

Any suggestions what to do to resolve the issue?

Kind regards,
Fredrik

Hi Fredrik,

Thanks for getting in touch! This looks like a bug we ran into ourselves just yesterday. Some versions of NuGet.exe have a regression where the push -Timeout argument wasn’t passed down to the HTTP request: https://github.com/NuGet/Home/issues/2785#issuecomment-236255073

I would recommend upgrading to OctoPack 3.4.5 which includes our custom build of NuGet.exe 3.5.0 complete with the fix for that bug.

Hope that helps!
Mike

Hi Fredrik,

Actually, upgrade to OctoPack 3.4.6 or newer - there was something wrong with the build and it got an old version of NuGet.exe. It’s been “one of those days”!

I’ve since confirmed OctoPack 3.4.6 has the correct version of NuGet.exe and made sure this mistake shouldn’t happen again.

Hope that helps!
Mike

Hi,

This did helped me after months struggling with the timeout.

Thanks a lot.

Regards,
Tri

Hi Tri,

That’s great news, I’m glad it helped!

Happy Deployments!
Mike