Hi, I am trying to setup service account for TeamCity, but it says that API key is invalid.
This error tested on 2.4.4 and 2.4.5 releases. Here is detailed log
@@@
An exception was thrown while trying to establish a principal for the current request
Octopus.Platform.Web.Security.OctopusSecurityException: The API key that you provided was not valid. Please double-check your API key and try again. For instructions on finding your API key, please visit: https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/Authentication
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.EnsureApiKeyValid(String attemptedKey, IOctopusPrincipal principal) in y:\work\db516cd4dfb6f424\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 118
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.GetPresentedUserIdentity(NancyContext context) in y:\work\db516cd4dfb6f424\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 89
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.EstablishPrincipalForRequest(NancyContext context) in y:\work\db516cd4dfb6f424\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 43
Warning 2014-05-19 17:04:10
You do not have permission to perform this action. Please contact your Octopus administrator. (http://deploy.directcrm.ru/api/projects)
Warning 2014-05-19 17:14:09
An exception was thrown while trying to establish a principal for the current request
Octopus.Platform.Web.Security.OctopusSecurityException: The API key that you provided was not valid. Please double-check your API key and try again. For instructions on finding your API key, please visit: https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/Authentication
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.EnsureApiKeyValid(String attemptedKey, IOctopusPrincipal principal) in y:\work\db516cd4dfb6f424\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 118
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.GetPresentedUserIdentity(NancyContext context) in y:\work\db516cd4dfb6f424\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 89
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.EstablishPrincipalForRequest(NancyContext context) in y:\work\db516cd4dfb6f424\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 43
@@@
And from Octo.exe:
@@@
Step 37/37: OctopusDeploy: Create release
[17:04:10][Step 37/37] Octopus Deploy
[17:04:10]Running command: octo.exe create-release --server http://deploy.directcrm.ru/ --apikey SECRET --project Demo --enableservicemessages --version 1.0.34 --deployto Staging --waitfordeployment
[17:04:10]Creating Octopus Deploy release
[17:04:10]Octopus Deploy Command Line Tool, version 2.4.2.54
[17:04:10]
[17:04:10]Handshaking with Octopus server: http://deploy.directcrm.ru/
[17:04:10]Handshake successful. Octopus version: 2.4.5.46; API version: 3.0.0
[17:04:10]Finding project: Demo
[17:04:10]Error from Octopus server (HTTP 403): You do not have permission to perform this action. Please contact your Octopus administrator.
[17:04:10]Exit code: -7
[17:04:10]Octo.exe exit code: -7
[17:04:10][Step 37/37] Unable to create or deploy release. Please check the build log for details on the error.
[17:04:10][Step 37/37] Step OctopusDeploy: Create release failed
@@@
Here is configuration http://screencast.com/t/QX0i7FHS
When I use API key from my account, it works fine http://screencast.com/t/DkfHX7r6vA8
@@@
Step 37/37: OctopusDeploy: Create release (24s)
[17:14:10]Octopus Deploy (23s)
[17:14:10]Running command: octo.exe create-release --server http://deploy.directcrm.ru/ --apikey SECRET --project Demo --enableservicemessages --version 1.0.35 --deployto Staging --waitfordeployment
[17:14:10]Creating Octopus Deploy release
[17:14:10]Octopus Deploy Command Line Tool, version 2.4.2.54
[17:14:10]
[17:14:11]Handshaking with Octopus server: http://deploy.directcrm.ru/
[17:14:11]Handshake successful. Octopus version: 2.4.5.46; API version: 3.0.0
[17:14:11]Finding project: Demo
[17:14:11]Finding deployment process for project: Demo
[17:14:11]Finding release template…
[17:14:12]Resolving NuGet package versions…
[17:14:12]Finding latest NuGet package for step: Deploy Package
[17:14:12]Using version number provided on command-line.
[17:14:12]Release plan for release: 1.0.35
[17:14:12]Steps:
[17:14:12] # Name Version Source
[17:14:12] — ---------------- --------------- ------------------------------------
[17:14:12] 1 Deploy Package 1.0.30 Latest available in NuGet repository
[17:14:12]
[17:14:12]Creating release…
[17:14:13]Release 1.0.35 created successfully!
[17:14:13]##teamcity[setParameter name=‘octo.releaseNumber’ value=‘1.0.35’]
[17:14:14]Deploying Demo 1.0.35 to: Staging (Guided Failure: Not Enabled)
[17:14:14]Waiting for 1 deployment(s) to complete…
[17:14:34]Deploy Demo release 1.0.35 to Staging: Success
[17:14:34]Done!
[17:14:34]Octo.exe exit code: 0
@@@