Octo pack and teamcity keep blowing up

im using teamcity 9.1.4 and octopack 3.4.7 in my helloworld mvc app. I have octopus 3.4.9. So when i select run octopack from the msbuild step and then use the octopus deploy everything works. The issue is that I can’t get a version number to apply to the nupkg . my artifact just keeps coming out as OwnerReviews.WebApi.1.0.0.0.nupkg even though my %build.number% is 1.0122.30 .
When i add %build.number% to the OctoPack package version I end up with the msbuild step crashing as it seems to suddenly try and push to octopus…even though the server and handshake are correct.
This step seems to insert when i add the package version but blows up.

:49][Exec] "F:\JetBrains\TeamCity\buildAgent\work\xx\HelloWorld\packages\OctoPack.3.4.7\tools\NuGet.exe"
push "F:\JetBrains\TeamCity\buildAgent\work\xx\HelloWorld\HelloWorld.WebApi\obj\octopacked\HelloWorld.WebApi.1.0122.53.nupkg"
API-xxddxxdsfddf -Source https://octopus.ci.mydomain.ca
[19:27:50][Exec] NuGet Version: 3.5.0.38733 (Custom build for OctoPack. See http://g.octopushq.com/VersioningInOctopusDeploy)
[19:27:51][Exec] Pushing HelloWorld.WebApi.1.0122.53.nupkg to ‘https://octopus.ci.mydomain.ca’…
[19:27:51][Exec] PUT https://octopus.ci.mydomain.ca/api/v2/package/
[19:27:54][Exec] NotFound https://octopus.ci.mydomain.ca/api/v2/package/ 3429ms
[19:27:54][Exec] Response status code does not indicate success: 404 (Not Found).
[19:27:54][Exec] F:\JetBrains\TeamCity\buildAgent\work\xx\HelloWorld\packages\OctoPack.3.4.7\tools\OctoPack.targets(108, 5):
error MSB3073: The command ""F:\JetBrains\TeamCity\buildAgent\work\xx\HelloWorld\packages\OctoPack.3.4.7\tools\NuGet.exe"
push "F:\JetBrains\TeamCity\buildAgent\work\xx\HelloWorld\HelloWorld.WebApi\obj\octopacked\HelloWorld.WebApi.1.0122.53.nupkg"
API-xxddxxdsfddf -Source https://octopus.ci.mydomain.ca " exited with code 1.

The annoying thing is that I do end up having a successful build on the teamcity server. I can see the version is there and octopacked correctly. I can search for it on the octopus server and it is there. But because it keeps breaking the msbuild step, I can’t trigger the deploy.

Can someone explain what might be going on? I most definitely need to have build versions It seems this is the only way to get a version number onto the nupkg.
using the latest nuget 4.0 RC2, msbuild 2015/x86 platform.
Been dealing with this all night and can’t wrap my head around the problem.

PS: I dont have any artifact paths or anything similar setup as I just need Teamcity to do its thing and then deploy to octopus.
Thank you for any assistance or ideas you might have.

Hi, thanks for getting in touch.

In the TeamCity plugin MSBuild step you need to enter the full URL of the Octopus built in feed, which in your case will be https://octopus.ci.mydomain.ca/nuget/packages If you only enter in the base Octopus URL Nuget.exe tries the default Nuget feed endpoint (/api/v2/endpoint) which is why you see that in your logs. I’m going to go and clear this up in our docs.

If you don’t want to push to Octopus in that step just leave the URL empty.

I hope that helps, if it doesn’t can you send a screenshot of the TeamCity step config?

Regards,
Mark

Hi Mark. Wow thanks so much for that information. It worked right away as
soon as I used the correct url. Is there some other reason though that it
is not automatically deploying from octopus now? I have the lifecycle setup
to auto deploy (lightning bolt/first environment) as soon as a new build
comes in but the deployment is not happening. Attached my msbuild step as
instructed. I have to now go into octopus and create the release manually.
[image: Inline image 1]

Mac McDell

c:778.231.3027
macmcdell@gmail.com

By default Octopus doesn’t automatically create a Release when you push packages. You have two options to get the Release created (which should then trigger the automatic deployment you have configured in your Lifecycle).

Typically in a TeamCity setup you would add a second build step to your TeamCity configuration using our TeamCity Create Release step and use that to create a Release as part of your TeamCity build. Since you are automatically triggering deployment of the Release already in your Lifecycle, leave the “Deploy to:” section of the step empty or you can end up triggering two deployments.

The second option is to use Automatic Release Creation in Octopus itself to create the release. You can find documentation on that here: http://docs.octopusdeploy.com/display/OD/Automatic+Release+Creation

I hope that helps.

Mark

Totally missed that in the octopus ui. Thanks very much for your
assistance.
MM

Mac McDell

c:778.231.3027
macmcdell@gmail.com