I recently moved my Teamcity configuration from an 8.1 server to a 9.1 server. I installed the Octopus plugin in teamcity (version 3.3.4) and checked the “Run OctoPack” in the MsBuild step.
I see the following behavior:
- The nupkg file is created without problems, and is present in the obj/octopacked folder in the agent working dir as expected.
- When the octopus plugin tries to publish the nupkg file as an artifact, it retries ten times, then gives up, and the Teamcity build stops at the current step without being marked as failed. The nupkg file is not available as an artifact. Even if the subsequent steps are set to always run even on failure, the build stops.
The Teamcity build log contains the following output:
[Step 1/2] Publishing artifacts (running for 51s)
[10:46:36][Publishing artifacts] Collecting files to publish: [D:\TeamCity9Agents\BuildAgent1\work\d73c9fcaf5d1e065\Server\Services\obj\octopacked\RestServices.develop.188.8.131.52.nupkg]
[10:46:39][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.184.108.40.206.nupkg] using [ArtifactsCachePublisher]
[10:46:39][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.220.127.116.11.nupkg] using [WebPublisher]
[10:46:40][Publishing artifacts] Recoverable problem publishing artifacts (will retry):
[10:46:41][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.18.104.22.168.nupkg] using [ArtifactsCachePublisher]
[10:46:41][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.22.214.171.124.nupkg] using [WebPublisher]
[10:46:43][Publishing artifacts] Recoverable problem publishing artifacts (will retry):
and then 8 more repeats of the last 3 lines, followed by silence, and no logging what so ever from the subsequent steps.
I am running the most recent version of the OctoPack nuget (3.0.60)
My Octopus server is running 126.96.36.1997, but I don’t assume that is relevant to what happens inside Teamcity
I have enabled debug logging in the teamcity agent, and the following exception occurs:
Note that publishing artifacts in the regular Teamcity way works fine, so this is an Octopack specific issue, I believe
Thanks for getting in touch. You are correct, the Octopus Server hasn’t even come into play by this point, so that version doesn’t matter.
When you are building your solution, the Octopus TeamCity plugin doesn’t really do much except for:
- Enable OctoPack by adding some parameters to your build
TeamCity takes care of finding and publishing files from your builds. My recommendation would be to contact JetBrains support to see if they can help.
Some things you could try:
- check the size of the artifact (is it really big?)
- are any other builds failing in a similar way?
- can you create a new build configuration just to build/package this application and see if that works?
Sorry I couldn’t be of more assistance.
I solved this. It turns out that my agents, which are hosted on the same machine as the teamcity server, were talking to the teamcity server via the URL https://teamcity.example.com, which is set up using IIS URL rewriting to forward to the actual tomcat URL http://teamcity.example.com:4242
This communication works for all intents and purposes except for publishing the octopack artifacts. If I change it to the raw http url with port number, octopack works.
Whether this is a bug in octopack or Teamcity, I don’t know
Thanks for getting back to me and I’m glad you got it sorted out.