Since upgrading to v2021.1 i am getting a “502 Invalid Argument” error when connecting to my Teamcity server.
When testing the NuGet connection from the External Feeds page it gives this response:
The V2 feed at 'http://localhost:8085/httpAuth/app/nuget/v1/FeedService.svc/Search()?$filter=IsAbsoluteLatestVersion&searchTerm='MySearchTerm'&targetFramework=''&includePrerelease=true&$skip=0&$top=10&semVerLevel=2.0.0' returned an unexpected status code '502 Invalid argument'.
From the Acquire Packages build step it gives this error:
Acquiring packages June 11th 2021 14:28:24Info Making a list of packages to acquire June 11th 2021 14:30:07Fatal The step failed: Activity failed with error 'The package xx.xx.xx v1.2106.263 could not be downloaded to the package cache from NuGet feed 'TeamcityFeedXXX' after making 5 attempts over a total of 102s. Make sure the package is pushed to the feed and try the deployment again. For a detailed troubleshooting guide go to http://g.octopushq.com/TroubleshootMissingPackages System.Exception: Unable to download package xx.xxx.xxx v1.2106.263 from NuGet feed 'TeamcityAUTH': The V2 feed at 'http://localhost:8085/httpAuth/app/nuget/v1/FeedService.svc/Packages(Id='xx.xxx.xx',Version='1.2106.263')' returned an unexpected status code '502 Invalid argument'. ---> NuGet.Protocol.Core.Types.FatalProtocolException: The V2 feed at 'http://localhost:8085/httpAuth/app/nuget/v1/FeedService.svc/Packages(Id='xx.xxx.xxx',Version='1.2106.263')' returned an unexpected status code '502 Invalid argument'. at NuGet.Protocol.V2FeedParser.<>c__DisplayClass53_0.<<LoadXmlAsync>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at NuGet.Protocol.HttpSource.ProcessResponseAsyncT at NuGet.Protocol.V2FeedParser.LoadXmlAsync(String uri, Boolean ignoreNotFounds, ILogger log, CancellationToken token) at NuGet.Protocol.V2FeedParser.QueryV2Feed(String relativeUri, String id, Int32 max, Boolean ignoreNotFounds, ILogger log, CancellationToken token) at NuGet.Protocol.V2FeedParser.GetPackage(PackageIdentity package, ILogger log, CancellationToken token) at Octopus.Core.Packages.NuGet.NuGetV2DownloadResource.DownloadPackage(PackageIdentity package, Action`1 process) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Core\Packages\NuGet\NuGetV2DownloadResource.cs:line 26 at Octopus.Shared.Util.TaskExtensions.PrepareForRethrow(Exception exception) at Octopus.Shared.Util.TaskExtensions.SafeResult[T](Task`1 task, CancellationToken cancellationToken) at Octopus.Core.Packages.NuGet.ExternalHttpNuGetPackageFeed.DownloadPackageToLocalCache(String packageId, IVersion version, ITaskContext taskContext, ILogContext logContext) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Core\Packages\NuGet\ExternalHttpNuGetPackageFeed.cs:line 183 --- End of inner exception stack trace --- at Octopus.Core.Packages.NuGet.ExternalHttpNuGetPackageFeed.DownloadPackageToLocalCache(String packageId, IVersion version, ITaskContext taskContext, ILogContext logContext) in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Core\Packages\NuGet\ExternalHttpNuGetPackageFeed.cs:line 208 at Octopus.Core.Packages.DeploymentPackageDownloader.<>c__DisplayClass8_0.<DownloadPackage>b__0() in C:\BuildAgent\work\c42ca9d2b8233f1c\source\Octopus.Core\Packages\DeploymentPackageDownloader.cs:line 77'.