Polling tentacles cannot download packages from TeamCity

My polling tentacles are unable to download the NuGet packages from my TeamCity server; if I connect via the server UI to the TeamCity feed and search for the deployment packages then I can find them, but when it comes to running the deployment, I get an error like this (see attached error log):

Attempt 5 of 5: Unable to download package Employgroup.Services.DataExport.11.3.0.21571-rc3 from NuGet feed 'TeamCity Feed' at https://teamcity.aussiepay.com.au/httpAuth/app/nuget/v1/FeedService.svc/: Error downloading Employgroup.Services.DataExport.11.3.0.21571-rc3 from http://teamcity.aussiepay.com.au:443/httpAuth/app/nuget/v1/FeedService.svc/download/Api_DataExportService_Trunk_Release/23351:id/Employgroup.Services.DataExport.11.3.0.21571-rc3.nupkg
The step failed: Activity failed with error 'The package Employgroup.Services.DataExport.11.3.0.21571-rc3 could not be downloaded 
to the package cache from NuGet feed 'TeamCity Feed' at https://teamcity.aussiepay.com.au/httpAuth/app/nuget/v1/FeedService.svc/ 
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 Employgroup.Services.DataExport.11.3.0.21571-rc3 from NuGet feed 'TeamCity Feed' at https://teamcity.aussiepay.com.au/httpAuth/app/nuget/v1/FeedService.svc/: Error downloading  Employgroup.Services.DataExport.11.3.0.21571-rc3 from http://teamcity.aussiepay.com.au:443/httpAuth/app/nuget/v1/FeedService.svc/download/Api_DataExportService_Trunk_Release/23351:id/Employgroup.Services.DataExport.11.3.0.21571-rc3.nupkg
---> System.Exception: Error downloading Employgroup.Services.DataExport.11.3.0.21571-rc3 from http://teamcity.aussiepay.com.au:443/httpAuth/app/nuget/v1/FeedService.svc/download/Api_DataExportService_Trunk_Release/23351:id/Employgroup.Services.DataExport.11.3.0.21571-rc3.nupkg
---> System.Net.Http.HttpRequestException: An error occurred while sending the request. 
---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. 
---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. 
---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

The tentacle is happily polling away at the server, so basic network connectivity appears to be working - any idea why it can’t retrieve the package that it knows exists?

ServerTasks-21512.log.txt (26 KB)

FYI TeamCity is v10.0.4 running on Windows Server 2016 (the same server as Octopus Deploy server); it is running behind an IIS reverse proxy (so that I can get the https://teamcity.aussiepay.com.au URL)

Hi David,

Thanks for getting in touch.

I think you are seeing the Octopus Server fail to download the package. Unless you have configured it otherwise, the Octopus Server will download the package from your NuGet feed and then send the package to your Tentacles. From your logs it looks like it’s the download on server part that is failing.

If you haven’t already done so, you could try enabling NuGet v2 on your TeamCity server by adding teamcity.nuget.api.version = v2 to internal.properties (https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206817105-How-to-enable-NuGet-feed-v2).

You could also try using localhost instead of your TeamCity url if your TeamCity and Octopus servers are running on the same box to rule out some kind of strange proxy issue.

Cheers,
Shane

It looks like the problem was the interaction between TeamCity and IIS; I removed IIS and had Tomcat serve up the HTTPS and things are working again.