Maven external feed - Unable to download package

Hello Octopus Team,

I’m having an issue downloading an artefact (bigger than 1Go) from an external Maven feed (Nexus) :

The package xxx-xxx-xxx:fichiers:zip v101.1-test could not be downloaded to the package cache from Maven feed 'xxx-build-xxx' after making 5 attempts over a total of 5103s. Make sure the package is pushed to the feed and try the deployment again. For a detailed troubleshooting guide go to
System.Exception: Unable to download package xxx-xxx-xxx:fichiers:zip v101.1-test from Maven feed 'xxx-build-xxx': Error while copying content to a stream.
 ---> System.Net.Http.HttpRequestException: Error while copying content to a stream.
 ---> System.IO.IOException: The response ended prematurely.
   at System.Net.Http.HttpConnection.FillAsync()
   at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionResponseContent.SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
   at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   --- End of inner exception stack trace ---
   at Octopus.Core.Packages.Maven.ExternalMavenPackageFeed.DownloadPackageToLocalCache(String packageId, IVersion version, ITaskContext taskContext, ILogContext logContext) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Core\Packages\Maven\ExternalMavenPackageFeed.cs:line 401
   at Octopus.Core.Packages.DeploymentPackageDownloader.<>c__DisplayClass8_0.<DownloadPackage>b__0() in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Core\Packages\DeploymentPackageDownloader.cs:line 123

Except unusual size of the artefact, nothing special to mention. POM file is fine and I can direct download the Artefact and expand it normaly from the Octopus server. In case it can be usefull the step type is : Deploy a Package.

Any ideas or similar issues from other users?



Hi Gregory,

Thanks for getting in touch, and sorry to hear you’re hitting that issue with your Maven feed.

I was wondering if you have tried changing the retry policy on the feed in Library > External Feeds > Maven feed? By default, this is set to retry 5 times with a linear backoff of 10s:

You might try upping the retry backoff or changing the number of attempts to see if it allows the package to be retrieved.

Also, are you able to retrieve other smaller packages from this feed? If you haven’t tried it yet, you might test and see if smaller ones work. If they do, then the issue is likely down to the package size which can hopefully be resolved by modifying the retry policy.

I hope this is helpful, and I look forward to hearing back from you.


Hi Patrick,

I’ve tried what you proposed, changed the number of retry up to 10 and the delay between retries up to 60s, without succes.

I have no problem to retrieve smaller packages from the same feed.



Hey Gregory,

Is this Nexus a maven 2 or maven 3 feed? I found that there might be settings we may need to tweak on the maven side: Tips for uploading very large files to Nexus – Sonatype Support
While that is for uploading, it’s possible it may apply to downloads as well. There might also be some other settings like a timeout we need to configure on the nexus side.

  • Is there anything in the logs for your nexus feed when the downloads are failing?
  • Anything in a WAF or other Firewall that indicates a closed connection?
  • Are you able to monitor how much(if any) of the file is being transferred before it fails?
  • Are you able to test downloading the package from that feed from that specific tentacle outside of Octopus to see if it succeeds or fails? Ideally with both a maven command as well as an http curl if possible.

Please let us know.


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