Nuget package download fail after upgrading to V2

Hi,

I just upgraded our Octopus server from 1.6 to 2.0. Download of nuget packages during deployment and release creation don’t work after the upgrade. This worked fine before upgrade. I’ve observed two problems.

  • I’m able to test the nuget feed and search for packages. Everything seem normal using that function

  • When I create a new release, Octopus are able to find the latest version of 32 of the 33 packages in the release. For one of them it is not able to find the latest release. I can search for it in the specify field and Octopus are able to find it then. So this is problem number one. Not able to find latest version of all packages.

  • The second problem is that Octopus mixes up the different packages in the feed. After creating a release(and specifying the one package version it could not find) I can go in and look at the release specification. In the list of packages in the release all the version numbers of the packages are correct, but the description on each package are all the same and taken from the first package in the feed(when sorted by name)

  • When I then try to deploy the release it fails during “Acquire packages”. The list of packages to download is correct and have the correct version numbers specified for all 33 packages. When it starts to download it fails because it mixes up the package s in the nuget feed. It appears to download the oldest version of the first package in the feed(when sorted by name) for all packages. It then fails because the downloaded package does not match the package it expected to get.

@@@
Finding package (attempt 5 of 5)
09:35:25Verbose
Attempt 5 of 5: Unable to download package: The package version ‘18.0.0.872’ returned from the package repository doesn’t match the requested package version ‘18.0.0.155’.
The package version ‘18.0.0.872’ returned from the package repository doesn’t match the requested package version ‘18.0.0.155’.
Octopus.Platform.Deployment.ControlledFailureException: The package version ‘18.0.0.872’ returned from the package repository doesn’t match the requested package version ‘18.0.0.155’.
at Octopus.Shared.Packages.PackageDownloader.FindPackage(Int32 attempt, PackageMetadata packageMetadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 150
at Octopus.Shared.Packages.PackageDownloader.AttemptToFindAndDownloadPackage(Int32 attempt, PackageMetadata packageMetadata, IFeed feed, IActivity log, String cacheDirectory, IPackage& downloadedPackage, String& path) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 130
at Octopus.Shared.Packages.PackageDownloader.AttemptToDownload(PackageMetadata metadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 89
09:35:30Error
Unable to download package:
The package version ‘18.0.0.872’ returned from the package repository doesn’t match the requested package version ‘18.0.0.155’.
Octopus.Platform.Deployment.ControlledFailureException: The package version ‘18.0.0.872’ returned from the package repository doesn’t match the requested package version ‘18.0.0.155’.
at Octopus.Shared.Packages.PackageDownloader.FindPackage(Int32 attempt, PackageMetadata packageMetadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 150
at Octopus.Shared.Packages.PackageDownloader.AttemptToFindAndDownloadPackage(Int32 attempt, PackageMetadata packageMetadata, IFeed feed, IActivity log, String cacheDirectory, IPackage& downloadedPackage, String& path) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 130
at Octopus.Shared.Packages.PackageDownloader.AttemptToDownload(PackageMetadata metadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 89
09:35:30Verbose
Failed receiving Octopus.Platform.Deployment.Messages.Deploy.Acquire.DownloadAndPushPackageToTentaclesCommand
The package could not be downloaded from NuGet. If you are getting a package verification error, try switching to a Windows File Share package repository to see if that helps.
Octopus.Platform.Deployment.ControlledFailureException: The package could not be downloaded from NuGet. If you are getting a package verification error, try switching to a Windows File Share package repository to see if that helps.
at Octopus.Shared.Packages.PackageDownloader.AttemptToDownload(PackageMetadata metadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 108
at Octopus.Shared.Packages.PackageDownloader.Download(PackageMetadata package, IFeed feed, PackageCachePolicy cachePolicy, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 53
at Octopus.Server.Orchestration.Deploy.Acquire.DownloadAndPushToTentaclesOrchestrator.d__7.MoveNext() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Orchestration\Deploy\Acquire\DownloadAndPushToTentaclesOrchestrator.cs:line 60
@@@

In the log 18.0.0.155 is the correct version, but 18.0.0.872 is the oldest version of the first package in the feed(when sorted by name). That package is not part of the release specification at all. I get the same type of error for all 33 packages in the release.

On a test server I set up a file based nuget feed to test with the same packages that are in our official http nuget feed. That seem to work. We use Artifactory as our nuget feed. It worked fine with Octopus 1.6 and appears to be correct. This looks like a Octopus bug.

I hope you are able to help me resolve these issues. I really don’t want to revert back to 1.6 since there are so many new features in 2.0 that we really need.

Regards,
Jan

I found a solution for the first issue. That Octopus could not find the latest version of one of the packages. This was a problem with casing in the package name.

The second and more serious problem persists. I’m still not able to get download of packages from a nuget feed to work.

Hi Jan,

Octopus 2.0 uses the newer NuGet 2.7 client, which is incompatible with older releases of Artifactory.

There’s a bug report on the Artifactory site with some details - does this match the behaviour you’re seeing?:

https://www.jfrog.com/jira/browse/TCAP-186
https://www.jfrog.com/jira/browse/RTFACT-5953

Best regards,
Nick

That explains it. Thanks for the tip. I’ll upgrade our Artifactory installation.

All the best,
Jan