Octopack artifact publish fails after upgrading TeamCity to version 9

Hi,

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.3.0.0.16.nupkg]
[10:46:39][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.3.0.0.16.nupkg] using [ArtifactsCachePublisher]
[10:46:39][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.3.0.0.16.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.3.0.0.16.nupkg] using [ArtifactsCachePublisher]
[10:46:41][Publishing artifacts] Publishing 1 file [Server/Services/obj/octopacked/RestServices.develop.3.0.0.16.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 2.5.10.567, 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:

jetbrains.buildServer.agent.ArtifactPublishingFailedException:
at jetbrains.buildServer.agent.publisher.WebPublisher.doPublish(WebPublisher.java:271)
at jetbrains.buildServer.agent.publisher.WebPublisher.splitByPartsAndPublish(WebPublisher.java:102)
at jetbrains.buildServer.agent.publisher.WebPublisher.publishFiles(WebPublisher.java:57)
at jetbrains.buildServer.agent.impl.artifacts.ArtifactProcessor$5$1.call(ArtifactProcessor.java:212)
at jetbrains.buildServer.agent.impl.artifacts.ArtifactProcessor$5$1.call(ArtifactProcessor.java:210)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Note that publishing artifacts in the regular Teamcity way works fine, so this is an Octopack specific issue, I believe

Hi Jonas,

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:

  1. 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.
Mike

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 :slight_smile:

Hi Jonas,

Thanks for getting back to me and I’m glad you got it sorted out.

Happy Deployments!
Mike