Octopack Failing to Find Project

Hi,

I am experiencing difficulties with having Team City successfully build a Nuget package for one of my projects.

I have an existing build step which creates a Nuget package for the main application.
I now want to add a new build step which will create a Nuget package for a Console application which uses DbUp to run deployment scripts.

I am getting the following error message (from the build log):

[13:07:09]Step 7/9: Create Release Database (OctopusDeploy: Create release) [13:07:09][Step 7/9] Octopus Deploy [13:07:09][Octopus Deploy] Running command: octo.exe create-release --server http://octopus.surgeons.org --apikey SECRET --project RACS.BQA.Database --enableservicemessages --version 1.0.0.442 --packageversion=1.0.0.442 [13:07:09][Octopus Deploy] Creating Octopus Deploy release [13:07:09][Octopus Deploy] Octopus Deploy Command Line Tool, version 3.3.16+Branch.master.Sha.47e0e502fcd994db2415887dc3bf8b3f248962a7 [13:07:09][Octopus Deploy] [13:07:09][Octopus Deploy] Build environment is NoneOrUnknown [13:07:09][Octopus Deploy] Handshaking with Octopus server: http://octopus.surgeons.org [13:07:10][Octopus Deploy] Handshake successful. Octopus version: 3.3.20; API version: 3.0.0 [13:07:10][Octopus Deploy] Authenticated as: David Rogers <david.rogers@surgeons.org> [13:07:10][Octopus Deploy] This Octopus Server supports channels [13:07:10][Octopus Deploy] Finding project: RACS.BQA.Database [13:07:10][Octopus Deploy] Could not find a project named 'RACS.BQA.Database'; either it does not exist or you lack permissions to view it. [13:07:10][Octopus Deploy] Exit code: -1 [13:07:10][Octopus Deploy] Octo.exe exit code: -1 [13:07:10][Step 7/9] Unable to create or deploy release. Please check the build log for details on the error. [13:07:10][Step 7/9] Step Create Release Database (OctopusDeploy: Create release) failed

As some background, I did originally name the project: RACS.BQA.DATABASE and changed it to RACS.BQA.Database
I have changed it to that latter naming in the solution file, GIT and everywhere else. I even completely removed it from the solution and re-added it.

The nuspec file does get created if I locally run a build in Release mode. Just not on Team City.

Not sure what the problem is here. I’ve done this successfully before.

Also note that I doubt it is a permissions issue. I have System Admin permissions on octopus and Admin permissions on Team City.

Hi David,

Thanks for getting in touch. In earlier versions of Octopus and Octo.exe, the casing of the project did matter.

The below powershell script will do an API call that’s very similar to what Octo.exe is doing to find the project. If you run it on your end using the same API key that’s being used in TeamCity, do you see the name of your project?

##SETUP##

$OctopusURL = "Https://deploy.octopushq.com" #Root of your Octopus web portal
$APIKey = "API-ZZN7WQOBK0ERFNBK5SX6BD6EK" #Your API Key

##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $APIKey }

$AllProjects = (Invoke-WebRequest $OctopusURL/api/projects/all -Headers $header).content | ConvertFrom-Json

$AllProjects.name

Regards,
Dalmiro

Hi Dalmiro. I have worked out what is going on. Basically, the previous build step which was building the main project artefact was also building the new artefact for the Database deploy project. I thought I needed a separate step for that.

So, this is solved. Thanks for getting in touch and I’ll keep your script as an aid for any possible future problems.