Releases getting wrong version of packages

Hi!

I’ve been testing Octopus Deploy for a couple months, and I’m really enthusiastic with it. I’m integrating it with Team City and it’s running well. But there is a small problem that I cannot figure out what is happening. I hope I can get some help here.

First, our scenario:

In Team City, we have 2 build configurations. The first one builds our projects and generate artifacts in our teamcity nuget feed. The second one is triggered when the first succeeds, and it creates a version in Octopus.

So, when a version is created, with our life cycle, Octopus automatically deploy it to an Acceptance environment. (We still work with just 2 environments: Acceptance and Production).

The problem:

When a version is created, sometimes the packages are correct, from the exactly team city build. (Octopus release number is the same number as Team City build number, so it’s easy to keep track and compare the build number, packages versions and octopus release). But, most of the times, the version of 1 or 2 packages are 1 behind, while other are correct. For example, we have a 4.38.61 release that points to 3 packages:
Package 1: 4.38.60
Package 2: 4.38.60
Package 3: 4.38.61

And also, once, something really strange happened when we had two near builds started in Team City. The package version was higher than the Octopus release. For example, we have a 4.38.61 release that points to 3 packages:
Package 1: 4.38.62
Package 2: 4.38.61
Package 3: 4.38.61

The question:
Am I doing anything wrong? I’ve searched through the web and forums and what I found that might cause this is having the release created in the same build configuration, and not having it triggered, so the packages were not ready yet. That’s not our case. Also, can I force when creating a release, getting that specific package, and not trusting it getting the latest automatically?

Thanks in advance!
Eric

Hi Eric,

Thanks for getting in touch.

I’m not sure exactly why that would happen, but I do have a suggestion:

You can supply a --packageversion option when creating the release (see the screenshot at the bottom of this page).
This will be used as the default version for all packages in the release. For more information on the options available for Octo.exe (the Team City plugin is just a wrapper for Octo.exe) see here.

Please let me know if this resolves your issue?

Regards,
Michael

Hi!

Thank you for you fast response, and sorry for taking some time to reply back. Yesterday was a holiday here.
So, I tried the --packageversion command and looks like it’s working perfect. I will let you know if it fails using the command, but I think it won’t.

Thank you so much!
Eric

You’re most welcome Eric.

Happy deployments,
Michael

Hi Michael,

I’ve had the same problem since moving from version 2.6 to version 3. It looks like you parameter works although I’ve only run a couple of builds and the error is intermittent so I’ll keep checking the releases, thanks for your help.

I’m not sure if it has any bearing on it but the NuGet repository I’m using is a windows share directory. An interesting point is that the incorrect deployment takes a lot longer, is it possible that the repository fetch times out and it uses out of date information?

Out of interest, what happens if the version I’ve specified in --packageversion doesn’t exist, will it create the deployment and just fail to deploy?

If it’s useful I’ve attached the TeamCity log files from an incorrect deployment and a fixed one below.

Thanks

Stu

Incorrect:

[13:52:59][Step 9/9] Octopus Deploy (23s)
[13:52:59][Octopus Deploy] Running command: octo.exe create-release --server http://entoctopusdeploy --apikey SECRET --project EDW Access --enableservicemessages --version 1.0.284
[13:52:59][Octopus Deploy] Creating Octopus Deploy release
[13:52:59][Octopus Deploy] Octopus Deploy Command Line Tool, version 2.1.2.36
[13:52:59][Octopus Deploy]
[13:52:59][Octopus Deploy] Handshaking with Octopus server: http://entoctopusdeploy
[13:53:02][Octopus Deploy] Handshake successful. Octopus version: 3.1.3; API version: 3.0.0
[13:53:02][Octopus Deploy] Finding project: EDW Access
[13:53:02][Octopus Deploy] Finding deployment process for project: EDW Access
[13:53:02][Octopus Deploy] Finding release template…
[13:53:02][Octopus Deploy] Resolving NuGet package versions…
[13:53:02][Octopus Deploy] Finding latest NuGet package for step: Install EDW Web Service
[13:53:22][Octopus Deploy] Release plan for release: 1.0.284
[13:53:22][Octopus Deploy] Steps:
[13:53:22][Octopus Deploy] # Name Version Source
[13:53:22][Octopus Deploy] — ------------------------- --------------- ------------------------------------
[13:53:22][Octopus Deploy] 1 Install EDW Web Service 1.0.283 Latest available in NuGet repository
[13:53:22][Octopus Deploy]
[13:53:22][Octopus Deploy] Creating release…
[13:53:23][Octopus Deploy] Release 1.0.284 created successfully!
[13:53:23][Octopus Deploy] ##teamcity[setParameter name=‘octo.releaseNumber’ value=‘1.0.284’]
[13:53:23][Octopus Deploy] Octo.exe exit code: 0

Corrected:

[Step 9/9] Octopus Deploy (4s)
[16:17:25][Octopus Deploy] Running command: octo.exe create-release --server http://entoctopusdeploy --apikey SECRET --project EDW Access --enableservicemessages --version 1.0.290 --packageversion 1.0.290
[16:17:25][Octopus Deploy] Creating Octopus Deploy release
[16:17:26][Octopus Deploy] Octopus Deploy Command Line Tool, version 2.1.2.36
[16:17:26][Octopus Deploy]
[16:17:26][Octopus Deploy] Handshaking with Octopus server: http://entoctopusdeploy
[16:17:29][Octopus Deploy] Handshake successful. Octopus version: 3.1.3; API version: 3.0.0
[16:17:29][Octopus Deploy] Finding project: EDW Access
[16:17:29][Octopus Deploy] Finding deployment process for project: EDW Access
[16:17:29][Octopus Deploy] Finding release template…
[16:17:29][Octopus Deploy] Release plan for release: 1.0.290
[16:17:30][Octopus Deploy] Steps:
[16:17:30][Octopus Deploy] # Name Version Source
[16:17:30][Octopus Deploy] — ------------------------- --------------- ------------------------------------
[16:17:30][Octopus Deploy] 1 Install EDW Web Service 1.0.290 User specified
[16:17:30][Octopus Deploy]
[16:17:30][Octopus Deploy] Creating release…
[16:17:30][Octopus Deploy] Release 1.0.290 created successfully!
[16:17:30][Octopus Deploy] ##teamcity[setParameter name=‘octo.releaseNumber’ value=‘1.0.290’]
[16:17:30][Octopus Deploy] Octo.exe exit code: 0

Hi Stuart!

I think you would like to know that since I’m using the packageversion parameter, I’ve never faced the problem again.

Att,
Eric

Hi Stu,

Really sorry for the delay in getting back to you. If it cannot find the package, it will not create the release.

Warm Regards,
Vanessa