Octopus not getting latest created package from teamcity feed. Get previous package

De Silva,
A fix for this issue has now been made and will be included in the next 3.0.12 release in the next day or so. Keep an eye on the downloads page and it should soon be ready for you to update.
I hope this solves your problem.
Cheers,
Rob

if you view the nuget feed from visual studio do you see this as the latest version?

Hi everyone,

Once we do a migration from an old version to up-to-date version (3.0.12 or
later) with our build/deployment production server, we will let you know if
this issue has been fixed.

Thank you!

Lester

Hi everyone,

Once we do a migration from an old version to up-to-date version (3.0.12 or later) with our build/deployment production server, we will let you know if this issue has been fixed.

Thank you!

Lester

I’m having the same issue… latest version of server and tentacle (3.1.1).

I’m using TeamCity’s nuget server, and the package is definitely showing the latest version if I browse to it using the package manager in Visual Studio.

However the Octopus Deploy step is using the previous version of the nuget package.

Not sure if this comment will help but I found that changing the case of the package name prevented proper identification of a more recent package being available.

for example the original package name was Businessone.Web and was assigned to a deploy nuget package step in the project. Now they decided to change the package name to BusinessOne.Web and we no longer saw any new versions even though browsing via the library they were there.

I resolved it by going into the step and updating the package name with the same case style that the newer packages were using and bam; they would show up in creating a release with the latest versions available.

I wasn’t using TeamCity but rather the builtin repository however it could be something similar to resolve if you changed the package name casing.

~ Steve

Hi Derek,

Thanks for reaching out. Are you creating the package and trying to deploy it during the same build process, but you find that the previous package is deployed instead? If that is the case, then the reason is that the new package is only available on your TeamCity Nuget feed only after the build finishes. For this to work, you’ll need to separate the package creating from the build trigger into 2 different build configurations, like this:

  1. Compile you app, create the packge and push it to the TC Nuget feed.
  2. Once the build configuration of the previous step finished successfully, trigger the deployment in Octopus.

If this is not the issue you are having, please explain us your scenario a bit more in detail, and if possible send us a TeamCity build log to support@OctopusDeploy.com

Thanks,

Dalmiro

I’m having this same problem. I have two separate steps in TeamCity, one to create the Nuget package and one to create the release in Octopus. Occasionally the Octopus step will grab an old version of the Nuget package and deploy it. It specifies the version when it creates the release so then everything gets messed up because it believes it’s a newer version that it actually is.

Log:
[Octopus Deploy] Finding latest NuGet package for step: Copy to Azure Storage
[18:49:24][Octopus Deploy] Using version number provided on command-line.
[18:49:24][Octopus Deploy] Release plan for release: 1.0.0.508
[18:49:24][Octopus Deploy] Steps:
[18:49:24][Octopus Deploy] # Name Version Source
[18:49:24][Octopus Deploy] — ----------------------- --------------- ------------------------------------
[18:49:24][Octopus Deploy] 1 Copy to Azure Storage 1.0.0.506 Latest available in NuGet repository
[18:49:24][Octopus Deploy]
[18:49:24][Octopus Deploy] Creating release…
[18:49:25][Octopus Deploy] Release 1.0.0.508 created successfully!

As you can see I’m trying to deploy 508 but it grabbed 506 and labelled it 508.

Also, in Octopus I have it set to use the version number from the Nuget package but it’s not doing that and it’s labelling it as 508 in Octopus as well.

Hi Derek,
Since the previous issue looks to have long been fixed months ago my suspicion is that you are likely facing a seperate problem.
Just to confirm you are definitely performing the create-release step in a seperate build configuration as outline previously by Vanessa?
As you probably saw reading through this thread there are several different problems/solutions throughout so its not immediately clear what your particular issue is. Could you please provide screenshots and logs of your build process, build configuration, project configuration and specific problem so we can start to pinpoint where the issue might be.
Thanks in advance,
Robert

Hi Mike & Derek,
My apologies the wrong post was showing up that I replied to. Derek please ignore my previous message.

Mike,
Could you confirm that you are correctly providing the packageversion variable in the create-release step. As outlined in the documentation the packageversion value is required to specify what version of the packages will be used for the release. The -version parameter is purely for the release version itself and does not affect the selected packages.
Could you please ensure that these values are being correctly set in the build step. If so, then please provide more details such as screenshots of the build process so we can determine what else could be wrong.
Thanks again,
Rob

Hey Rob,

Thanks for the reply.

I’m using TeamCity to create the Octopus release and the release number field seems to be populated correctly.

From the log though it seems to be using that value in the version parameter, not the packageversion parameter:

[Step 1/1] Octopus Deploy (56s)
[18:49:20][Octopus Deploy] Running command: octo.exe create-release --server http://build1azure.cloudapp.net/ --apikey SECRET --project Dentrix --enableservicemessages --version 1.0.0.508 --deployto Development --progress
[18:49:20][Octopus Deploy] Creating Octopus Deploy release
[18:49:21][Octopus Deploy] Octopus Deploy Command Line Tool, version 3.3.0+Branch.master.Sha.dbca2469436b65404660559315baeb71d40c5d53
[18:49:21][Octopus Deploy]
[18:49:22][Octopus Deploy] Handshaking with Octopus server: http://build1azure.cloudapp.net/
[18:49:22][Octopus Deploy] Handshake successful. Octopus version: 3.2.15; API version: 3.0.0
[18:49:22][Octopus Deploy] Authenticated as: Mike Cousins mike@brightsquid.com
[18:49:22][Octopus Deploy] Finding project: Dentrix
[18:49:22][Octopus Deploy] Finding deployment process for project: Dentrix
[18:49:23][Octopus Deploy] Finding release template…
[18:49:23][Octopus Deploy] Resolving NuGet package versions…
[18:49:23][Octopus Deploy] Finding latest NuGet package for step: Copy to Azure Storage
[18:49:24][Octopus Deploy] Using version number provided on command-line.
[18:49:24][Octopus Deploy] Release plan for release: 1.0.0.508
[18:49:24][Octopus Deploy] Steps:
[18:49:24][Octopus Deploy] # Name Version Source
[18:49:24][Octopus Deploy] — ----------------------- --------------- ------------------------------------
[18:49:24][Octopus Deploy] 1 Copy to Azure Storage 1.0.0.506 Latest available in NuGet repository
[18:49:24][Octopus Deploy]
[18:49:24][Octopus Deploy] Creating release…
[18:49:25][Octopus Deploy] Release 1.0.0.508 created successfully!
[18:49:25][Octopus Deploy] ##teamcity[setParameter name=‘octo.releaseNumber’ value=‘1.0.0.508’]
[18:49:26][Octopus Deploy] Deploying Dentrix 1.0.0.508 to: Development (Guided Failure: Not Enabled)
[18:49:26][Octopus Deploy] Waiting for 1 deployment(s) to complete…
[18:49:57][Octopus Deploy] Success: Acquire packages
[18:50:07][Octopus Deploy] Success: Step 1: Copy to Azure Storage
[18:50:07][Octopus Deploy] Success: Apply retention policy on Tentacles
[18:50:17][Octopus Deploy] Success: Step 2: Slack - Notify Deployment
[18:50:17][Octopus Deploy] Deploy Dentrix release 1.0.0.508 to Development: Success
[18:50:17][Octopus Deploy] Done!
[18:50:17][Octopus Deploy] Octo.exe exit code: 0

Hi Mike,
The Release Number field is a reference to the number of the release itself not the packages that are used in the release. Remember that the release version is a different concept to the package version. You will need to add something along the lines of --packageversion=%build.number% to the additional command line arguments field.

Check out this tutorial we have on creating team city deployments as well as the octo.exe documentation which is being used under the hood of this TeamCity plugin.
I hope this gets you back on the path to deploying.
Cheers,
Rob

What will happen if that version doesn’t exist at the time that it runs?

I have made the changes and everything looks good. I assume it will fail if I ever get into the race condition that I was in before (it only happens probably 5% of the time), but a failure is better than it deploying a mislabeled release IMO.

Thanks for your help.

From: Mike Cousins
Sent: Thursday, January 14, 2016 4:21 PM
To: ‘Rob Erez’ tender2+dc6c0e79c0@tenderapp.com
Subject: RE: Octopus not getting latest created package from teamcity feed. Get previous package [Problems #29787]

What will happen if that version doesn’t exist at the time that it runs?

Mike
Glad to hear you have it sorted now.

It will allow you to create a releases with a package version that doesnt exist yet, it just has to exist at deployment time. Be careful though since you could then have a race condition if you are run create-release with deploy-to and you don’t yet have the package in your repository.
Cheers,
Rob