Failure to pickup and deploy package at the start of deployment

Have been seeing this error a lot lately, where the NuGet package can’t be downloaded from the NuGet server to the machine I’m deploying to.

It claims the contents of the package can’t be verified, but I can browse through the package no problem with the Package Explorer, so I know the package is valid.

It seems to be looking for something in C:\Teamcity, which I don’t have on any of my machines, but that may be a red herring…?

2011-09-30 14:07:57 INFO Deploying release ‘2011.9.30.5’ of project ‘Test Service’ into environment 'Development’
2011-09-30 14:07:57 INFO Downloading NuGet package Mnetics.TestService 2011.9.30.5 from feed: 'http://nugetserver:10418/nuget
2011-09-30 14:07:57 DEBUG Found package Mnetics.TestService 2011.9.30.5
2011-09-30 14:07:58 ERROR System.IO.InvalidDataException: Failed to download package correctly. The contents of the package could not be verified.
at NuGet.PackageDownloader.DownloadPackage(IHttpClient downloadClient, Byte[] packageHash, IPackageMetadata package)
at NuGet.DataServicePackage.DownloadAndVerifyPackage(IPackageRepository repository)
at NuGet.DataServicePackage.GetStream()
at NuGet.FileSystemExtensions.AddFileWithCheck(IFileSystem fileSystem, String path, Func1 streamFactory) at Octopus.Server.Deploy.PackageFetcher.Fetch(String feed, String packageId, String version) in c:\TeamCity\buildAgent\work\93ea602cb1d1c3f2\source\Octopus.Server\Deploy\PackageFetcher.cs:line 37 at Octopus.Server.Deploy.DeployTaskExecutor.DownloadPackagesInThisRelease(IEnumerable1 packages, IList`1 steps) in c:\TeamCity\buildAgent\work\93ea602cb1d1c3f2\source\Octopus.Server\Deploy\DeployTaskExecutor.cs:line 73
at Octopus.Server.Deploy.DeployTaskExecutor.Execute(String arguments) in c:\TeamCity\buildAgent\work\93ea602cb1d1c3f2\source\Octopus.Server\Deploy\DeployTaskExecutor.cs:line 60
at Octopus.Server.Tasks.TaskQueue.<>c__DisplayClass3.b__0(Object ) in c:\TeamCity\buildAgent\work\93ea602cb1d1c3f2\source\Octopus.Server\Tasks\TaskQueue.cs:line 89

Hi Neil,

This appears to be a problem with the NuGet server and has affected a few people - I have a long thread (unfortunately private) where we eliminated all the possible causes. I haven’t had time to investigate what the problem is, but the workaround is to use an alternative to the NuGet server.

If your machines are on the same network, you can simply use a Windows File Share (e.g., \YourServer\Packages). Octopus will work just fine with that. We found that the same package that failed under NuGet.Server worked fine under a file share, which is why we suspect the problem is in NuGet.Server.

I’ll be investigating the problem with NuGet.Server this week and I’ll update you when I have a result.

Paul

That’s great, thanks. I look forward to the resolution, keep me posted :slight_smile:

Hi,

Just to add that I’ve experienced this too, the solution for us is to rebuild the relevant package in Teamcity. Unfortunately our app contains quite a few solutions and sometimes more than 1 needs to be repackaged, but you can’t tell until you try to deploy which ones are ‘corrupt’.

In my opinion I think the issue is the NuGet server (we’re running v1.4.20609.9012), but can’t say I have any hard evidence at this point to back that statement up :frowning:

John

hI,

After loading the XML file form Octopus I am getting the below errorl
Setting up the Octopus Agent failed: System.NullReferenceException: Object .

I have done the re-install the octopus and it works for me of two times only after that it agains hits me with the same error

Can you please tell me how to resolve this isssue.