We are evaluating Octopus Deploy for use together with TeamCity. We have reached the step when TeamCity server successfully creates a NuGet package for the component (using OctoPack), but deployment to the server (with a tentacle installed) fails. Here what happens:
- The name of the Web service project to be deployed is NRK.DsIts.Host.
- I can see that the project build output contains NRK.DsIts.Host.188.8.131.52.nupkg file, and the version number 184.108.40.206 corresponds to the one generated by TeamCity.
- The Octopus Deploy project name is DsIts.
- Here’s the build output:
[12:43:17][Octopus Deploy] Running command: octo.exe deploy-release --server https://mabuild01:8443 --apikey SECRET --project DsIts --enableservicemessages --version 220.127.116.11 --deployto Dev
[12:43:17][Octopus Deploy] Promoting Octopus Deploy release
[12:43:17][Octopus Deploy] Octopus Deploy Command Line Tool, version 18.104.22.168
[12:43:17][Octopus Deploy] Handshaking with Octopus server: https://mabuild01:8443
[12:43:20][Octopus Deploy] Handshake successful. Octopus version: 22.214.171.1240; API version: 3.0.0
[12:43:20][Octopus Deploy] Finding project: DsIts
[12:43:20][Octopus Deploy] Finding release: 126.96.36.199
[12:43:20][Octopus Deploy] Error from Octopus server (HTTP 404): The resource ‘Release ‘188.8.131.52’ for project ‘projects-1’’ was not found.
[12:43:20][Octopus Deploy] Exit code: -7
[12:43:20][Octopus Deploy] Octo.exe exit code: -7
What is strange here is the text “The resource 'Release ‘184.108.40.206’ for project ‘projects-1’”. What is “projects-1”? The only project we have is DsIts.
Also, if I go to Releases section of the project, I see text “This project hasn’t had any releases yet. To create the first release, use the button in the upper-right tools area.”, but I don’t see any button in the upper-right tools area.
Any ideas of what can go wrong here?
Thanks in advance
To add more information: I haven’t set up NuGet feed for the projects because I was under impression that TeamCity plugin should handle it. I guess I misunderstood this. Does this mean that in addition to OctopusDeploy build step I have to create a another build step to copy NuGet package to file share that Octopus will be using?
I have now set up NuGet field in Octopus server, so I can see that there is a package published by TeamCity. Still the same error (see below). Can it be that there is a mismatch between package Id and project name?
Here’s the most recent package:
And here’s the deployment log:
Running command: octo.exe deploy-release --server https://mabuild01:8443 --apikey SECRET --project DsIts --enableservicemessages --version 220.127.116.11 --deployto Dev
Handshaking with Octopus server: https://mabuild01:8443
Handshake successful. Octopus version: 18.104.22.1680; API version: 3.0.0
Finding project: DsIts
Finding release: 22.214.171.124
Error from Octopus server (HTTP 404): The resource ‘Release ‘126.96.36.199’ for project ‘projects-1’’ was not found.
… to give even more insight: manual deployment from Octopus Web site works fine. It’s just deployment from TeamCity that fails.
I beleive the
octo.exe create-release command is the one you need. If you’re using the TC plug-in, the “OctopusDeploy: Release” action should invoke this (it looks like the output above is from “OctopusDeploy: Promote”).
Hope this helps,
Thank you for the hint. Yes, that was it. I thought Release action only builds releases while Promote builds and promotes. I was wrong
I just ran into this as well. We had inadvertently chosen “deploy release” instead of “create release”. I have two suggestions:
- Improve the error message to suggest as a corrective action to switch the plugin selection to “create release”.
- When switching between create, deploy, and promote, though the form fields are largely the same, they already entered values are wiped. This is super annoying and particularly problematic if the user does not have access to generate a new api key hash.
Thank you david , your comment helped me to solve my problem
Had the same Problem… The error message seams not yet improved!?!
This was the cause of 2 days spent head scratching!
I had the same problem and changing it to create release resolved the “Error from Octopus server (HTTP 404): The resource ‘Release ‘188.8.131.52’ for project ‘projects-1’’ was not found.” error.
But for some reason Team City is creating two NuGet packages. The first package seems to be based off of one subfolder in the project, not the whole project. The second package includes the whole project. But Octopus is only deploying the first package.
I wonder if the octopus package was installed into the project twice somehow.
An alternative to CREATE release is to use the “Automatic Release” option in the process tab of your project.
“Create a release when a package is pushed to the built-in package repository”
Octopus will create the release when TC pushes the packages…
Solved my problem, the youtube deployment video was showing simply Release as the runner type.