Package download retry logic?

Jul 7, 2011 at 6:09 PM

Hey all,

we are using nuget inside our firewall and are finding that our distributed offices have a less then optimal network connection.  As a result of network issues, we commonly see the following errors when trying to install packages.

Attempting to resolve dependency 'AppFabric'.

Install-Package : Failed to download package correctly. The contents of the package could not be verified.

At line:1 char:16

+ Install-Package <<<<  dell-appframework-configuration

    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidDataException

    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand


We usually find that retrying a couple of times and sometimes waiting till the network is not saturated seems to solve the problem of working with these bad connections.


I was wondering if there has been any thought around adding some retry logic to downloading packages to be more tolerant of slow network connections?




Jul 7, 2011 at 6:23 PM

Do you know what's happening at the http level when that fails?

Jul 7, 2011 at 6:32 PM

Are you using NuGet.Server? If you are, what version are you using?

Jul 7, 2011 at 8:03 PM

@dfowler, We are using a pretty old version of the nuget.server.  I will need to check on that.

@davidebbo, I will get a fiddler capture of the failed requests and see whats happening.


Jul 7, 2011 at 8:27 PM

It looks like we are running the 1.0 server .

I have a fiddler capture, how do you want it.  I have it as a .saz (1 MB)

Jul 7, 2011 at 8:32 PM

Maybe just share the one error to start with. e.g. is it a 500? Or just some connection timeout? If you want to share out the .saz from somewhere, that'll be fine too.

Jul 7, 2011 at 8:48 PM

Before doing any of that I'd update NuGet.Server.

Jul 7, 2011 at 9:43 PM

Yeah.. all the requests in this case return 200s.  

I thought you would ask me to update the server... unfortunately, that is way easier said then done.  We will need to repack the packages with 1.4 right?

Jul 7, 2011 at 11:07 PM

No, I wouldn't think so. The 1.4 server should support packages that were built using 1.0 or later. Unless Fowler says otherwise! :)

Jul 8, 2011 at 12:46 AM

Do you have your nuget server added to an existing site? You just need to install the package and it should just work.

Jul 11, 2011 at 3:10 PM

The problem is not installing it.. it is getting it redeployed to our internal build farm.  :)

Jul 11, 2011 at 4:10 PM

Automation is the key my friend. :) At some point, you're going to have to update that bad boy to keep up with the NuGet changes. Now's probably as good a time as ever. I've been toying with the idea of having the NuGet.Server components within a website be self-updateable (ala Would that help you or is that something you'd never consider using in this particular case? :)

Jul 11, 2011 at 4:27 PM
I could see us using the auto update if it supported the rollback.