Timeout Pushing Package to Octopus from Jenkins

Jenkins builds, uses Octo.exe to push to Octopus, and it times out with this message from Jenkins:

Pushing LibertyMutual.Staging2.1.1.118.nupkg to 'http://deploy/nuget/packages'... PUT http://deploy/nuget/packages/ An error was encountered when fetching 'PUT http://deploy/nuget/packages/'. The request will now be retried. The HTTP request to 'PUT http://deploy/nuget/packages/' has timed out after 100000ms. PUT http://deploy/nuget/packages/ An error was encountered when fetching 'PUT http://deploy/nuget/packages/'. The request will now be retried. The HTTP request to 'PUT http://deploy/nuget/packages/' has timed out after 100000ms. PUT http://deploy/nuget/packages/ A task was canceled. Pushing took too long. You can change the default timeout of 300 seconds by using the -Timeout <seconds> option with the push command.

On the Octopus side, I have this in the diagnostics:

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.<CopyTo>b__2(IAsyncResult writeResult) 2017-01-09 17:06:45 Error Unhandled exception from web server: One or more errors occurred. System.Net.HttpListenerException (0x80004005): An operation was attempted on a nonexistent network connection at System.Net.HttpRequestStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) at Nancy.Extensions.StreamExtensions.<>c__DisplayClass3.<CopyTo>b__2(IAsyncResult writeResult)

I’m not 100% that they’re related, as the time codes don’t line up perfectly. This is a LARGE package, and smaller packages seem to succeed. Making the package smaller is going to be problematic…is there some way to force Octopus to accept the package?

Hi,

Thanks for reaching out! The solution here would be to increase the timeout value of the push command. The problem is that Octo.exe still doesn’t have such parameter yet, but it is coming soon.

For the time being I’d recommend you to use Nuget.exe push instead, which does have a -timeout parameter: https://docs.nuget.org/ndocs/tools/nuget.exe-cli-reference#push

Regards,
Dalmiro

So, do you mean adding a new build step prior to the octo step for creating a release that would push the package?

Hi,

Good news: since our last conversation, the timeout parameter was added to Octo.exe push: https://github.com/OctopusDeploy/Issues/issues/2868

This means that if you upgrade your TeamCity plugin to the latest version, you should be able to add --timeout [int] in your TC Octopus step on the “Additional Arguments” field.

You can download the plugin from here: https://octopus.com/downloads

Let me know how that goes,
Dalmiro

We’re using Jenkins with the following MSBUILD command:

/t:Build /p:RunOctoPack=true /p:OctoPackPublishPackageToHttp=http://deploy/nuget/packages /p:OctoPackPublishApiKey=${OctopusAPIKey} /p:OctoPackPackageVersion=1.1.${BUILD_NUMBER} /p:OctoPackReleaseNotesFile=‘C:\Program Files (x86)\Jenkins\jobs%JOB_NAME%\builds%BUILD_NUMBER%\releasenotes.txt’ /p:Configuration=Release
/p:Timeout=55000

But still getting the timeouts. Any ideas?

It doesn’t look like Octopack is propagating the timeout switch to the nuget call, so it’s still timing out. Tried lowercase, too. We’re running 3.4.7 of Octopack.

Oh you are using Octopack for the package push! Your initial sentence confused me a bit: Jenkins builds, uses Octo.exe to push to Octopus

To setup a timeout for the package push in Octopack you need to pass the argument to msbuild like this: “/p:OctoPackNuGetPushProperties=-Timeout=55000”.

That single argument should be double-quoted, so the whole thing would look like

/t:Build /p:RunOctoPack=true /p:OctoPackPublishPackageToHttp=http://deploy/nuget/packages /p:OctoPackPublishApiKey=${OctopusAPIKey} /p:OctoPackPackageVersion=1.1.${BUILD_NUMBER} /p:OctoPackReleaseNotesFile=‘C:\Program Files (x86)\Jenkins\jobs%JOB_NAME%\builds%BUILD_NUMBER%\releasenotes.txt’ /p:Configuration=Release “/p:OctoPackNuGetPushProperties=-Timeout=55000”

Let me know how it goes. If it doesn’t work, send me a full Jenkins build log so I can check it out.

Cheers,
Dalmiro

This generates this command:

“C:\Program Files (x86)\Jenkins\workspace\NorthernTrust\Code\packages\OctoPack.3.4.7\tools\NuGet.exe” push “C:\Program Files (x86)\Jenkins\workspace\NorthernTrust\Code\PartnerComm.NorthernTrust.Web\obj\octopacked\PartnerComm.NorthernTrust.Web.1.1.746.nupkg” ******** -Source http://deploy/nuget/packages -Timeout=55000

Which has this result:

Unknown option: ‘-Timeout=55000’

And it fails there.

Thanks,
CBB

[cid:purp_logo_0de02fc0-537e-40f9-91f8-ec240bfb9285.png]

Chris Behrens
Senior Software Architect
Phone: (817) 465-9277
2304 Interstate 20 West, Suite 250 | Arlington, TX 76017
www.partnercomm.net http://www.partnercomm.net

This e-mail transmission may contain confidential information or may be otherwise legally privileged. If you are not the intended recipient you are hereby notified that any use, disclosure, copying, forwarding, or distribution of any of the information contained in or attached to this message is STRICTLY PROHIBITED.

purp_logo_0de02fc0-537e-40f9-91f8-ec240bfb9285.png

I experimented with a number of variations, and I finally got it to accept:

“/p:OctoPackNuGetPushProperties=-Timeout 55000”

But it still times out after 100s. Apparently the timeout is not actually implemented by Nuget…I found some other articles online.

I’m beginning to think that this is just an impassable limit for working with Octopus. We may have to find some other solution.

Thanks,

CBB

[cid:purp_logo_0de02fc0-537e-40f9-91f8-ec240bfb9285.png]

Chris Behrens
Senior Software Architect
Phone: (817) 465-9277
2304 Interstate 20 West, Suite 250 | Arlington, TX 76017
www.partnercomm.net http://www.partnercomm.net

This e-mail transmission may contain confidential information or may be otherwise legally privileged. If you are not the intended recipient you are hereby notified that any use, disclosure, copying, forwarding, or distribution of any of the information contained in or attached to this message is STRICTLY PROHIBITED.

purp_logo_0de02fc0-537e-40f9-91f8-ec240bfb9285.png

Hi Chris,

That behavior sounds a lot like this regression bug from Nuget: https://github.com/dotnet/core-setup/pull/1187 . I’m gonna pass this to our team to get some thoughts and get back to you.

In the meantime and to get you up and running: Octopack is only 1 of the ways to create a Nuget package and push it to Octopus. Another one that I personally like more is to hook up Octo.exe in your build steps to pack and push your package. You can read more about this console app here:

Packing packages: http://docs.octopus.com/display/OD/Using+Octo.exe
Pushing Packages: http://docs.octopus.com/display/OD/Pushing+packages
Download link (the one that says “Command Line”): https://octopus.com/downloads

This should take care of the exact same tasks as Octopack.

Let me know how that goes,
Dalmiro