Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

triggerpipeline: VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed #243

Closed
bmpnext opened this issue Nov 30, 2020 · 7 comments

Comments

@bmpnext
Copy link

bmpnext commented Nov 30, 2020

Hi Maik,

we are getting an error when using 'Trigger Azure DevOps Pipeline' with Release-Pipeline:

2020-11-30T12:48:45.9349713Z ##[section]Starting: Trigger Azure DevOps Pipeline: Release
2020-11-30T12:48:45.9471140Z ==============================================================================
2020-11-30T12:48:45.9471599Z Task : Trigger Azure DevOps Pipeline
2020-11-30T12:48:45.9472012Z Description : Build and Release Management task to trigger a Azure DevOps release or build pipeline.
2020-11-30T12:48:45.9472350Z Version : 1.1.10
2020-11-30T12:48:45.9472602Z Author : Maik van der Gaag
2020-11-30T12:48:45.9472842Z Help :
2020-11-30T12:48:45.9473139Z ==============================================================================
2020-11-30T12:48:47.0925224Z ******************************
2020-11-30T12:48:47.1008638Z ** Service Connection: xxxxx
2020-11-30T12:48:47.1009401Z ** Release Url: https://vsrm.dev.azure.com/xxxxx
2020-11-30T12:48:47.1010132Z ** Organization Url: https://dev.azure.com/xxxx
2020-11-30T12:48:47.1013185Z ** Token: ***
2020-11-30T12:48:47.1013831Z ** Project name: xxxxxx
2020-11-30T12:48:47.1014234Z ** Pipeline: Release
2020-11-30T12:48:47.1014639Z ** Build pipeline:
2020-11-30T12:48:47.1015004Z ** Release pipeline: chatbot
2020-11-30T12:48:47.1015330Z ** Description:
2020-11-30T12:48:47.1015640Z ** Branch:
2020-11-30T12:48:47.1015927Z ** BuildNumber:
2020-11-30T12:48:47.1016312Z ** Stages: dev
2020-11-30T12:48:47.1016646Z ******************************
2020-11-30T12:48:48.2561067Z ##[error]VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed.
2020-11-30T12:48:48.2886502Z ##[section]Finishing: Trigger Azure DevOps Pipeline: Release

Actuall I think it might be releated to:

Would be great if you could have a look.

Best regards
Björn

@maikvandergaag
Copy link
Owner

Hi Bjorn, This is because the pipeline you are trying to trigger is already running.

@bmpnext
Copy link
Author

bmpnext commented Nov 30, 2020

Hi Maik,

this should not be the case. Please have a look at the following log timestamps and the target release pipeline deployments (screenhot). Last recent deployment was several hours ago.

2020-11-30T15:02:23.2196882Z ##[section]Starting: Trigger Azure DevOps Pipeline: Release
2020-11-30T15:02:23.2397782Z ==============================================================================
2020-11-30T15:02:23.2398327Z Task : Trigger Azure DevOps Pipeline
2020-11-30T15:02:23.2398852Z Description : Build and Release Management task to trigger a Azure DevOps release or build pipeline.
2020-11-30T15:02:23.2399474Z Version : 1.1.10
2020-11-30T15:02:23.2399832Z Author : Maik van der Gaag
2020-11-30T15:02:23.2400157Z Help :
2020-11-30T15:02:23.2400553Z ==============================================================================
2020-11-30T15:02:25.1648718Z ******************************
2020-11-30T15:02:25.1653379Z ** Service Connection: 9628c8c4-0a32-45dc-8b7d-82bbd4682517
2020-11-30T15:02:25.1659830Z ** Release Url: https://vsrm.dev.azure.com/xxx
2020-11-30T15:02:25.1666705Z ** Organization Url: https://dev.azure.com/xxx
2020-11-30T15:02:25.1674352Z ** Token: ***
2020-11-30T15:02:25.1679462Z ** Project name: xxx
2020-11-30T15:02:25.1686293Z ** Pipeline: Release
2020-11-30T15:02:25.1692604Z ** Build pipeline:
2020-11-30T15:02:25.1698648Z ** Release pipeline: chatbot
2020-11-30T15:02:25.1705161Z ** Description:
2020-11-30T15:02:25.1711146Z ** Branch:
2020-11-30T15:02:25.1717537Z ** BuildNumber:
2020-11-30T15:02:25.1724167Z ** Stages: dev
2020-11-30T15:02:25.1729568Z ******************************
2020-11-30T15:02:26.6945240Z ##[error]VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed.
2020-11-30T15:02:26.7337493Z ##[section]Finishing: Trigger Azure DevOps Pipeline: Release

image

Best regards
Björn

@maikvandergaag
Copy link
Owner

Hi Bjorn,

The error message tells us that the stage at the time of trigger is already queued for a build or release. Meaning that is can not set it to in progress.

Could you add the system.debug variable with the value true to the pipeline and send me the log.

@bmpnext
Copy link
Author

bmpnext commented Nov 30, 2020

Hi Maik,

may it be possible that the first call is already starting the deployment?

$Result = Invoke-RestMethod -Uri $RunReleaseUri -Method Post -ContentType "application/json" -Headers $DevOpsHeaders -Body $jsonbody;

Log with system.debug

2020-11-30T16:12:53.6737337Z ##[debug]Evaluating condition for step: 'Trigger Azure DevOps Pipeline: Release'
2020-11-30T16:12:53.6739407Z ##[debug]Evaluating: succeeded()
2020-11-30T16:12:53.6740003Z ##[debug]Evaluating succeeded:
2020-11-30T16:12:53.6741742Z ##[debug]=> True
2020-11-30T16:12:53.6742382Z ##[debug]Result: True
2020-11-30T16:12:53.6743019Z ##[section]Starting: Trigger Azure DevOps Pipeline: Release
2020-11-30T16:12:53.6875628Z ==============================================================================
2020-11-30T16:12:53.6876272Z Task : Trigger Azure DevOps Pipeline
2020-11-30T16:12:53.6876938Z Description : Build and Release Management task to trigger a Azure DevOps release or build pipeline.
2020-11-30T16:12:53.6877529Z Version : 1.1.10
2020-11-30T16:12:53.6877934Z Author : Maik van der Gaag
2020-11-30T16:12:53.6878339Z Help :
2020-11-30T16:12:53.6878829Z ==============================================================================
2020-11-30T16:12:54.7559335Z ##[debug]VstsTaskSdk 0.10.0 commit 787a46ec0a2df5b4d12c2e801bd3f319975c054c
2020-11-30T16:12:54.9562652Z ##[debug]Entering D:\a_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1.
2020-11-30T16:12:54.9939510Z ##[debug]INPUT_CONNECTEDSERVICENAME: '9628c8c4-0a32-45dc-8b7d-xxxxxx'
2020-11-30T16:12:55.0053753Z ##[debug]ENDPOINT_URL_9628c8c4-0a32-45dc-8b7d-xxxxxx: 'https://dev.azure.com/xxx'
2020-11-30T16:12:55.0148337Z ##[debug]ENDPOINT_AUTH_9628c8c4-0a32-45dc-8b7d-xxxxxx: '********'
2020-11-30T16:12:55.0167609Z ##[debug]ENDPOINT_DATA_9628c8c4-0a32-45dc-8b7d-xxxxxx: '{"releaseUrl":"https://vsrm.dev.azure.com/xxx"}'
2020-11-30T16:12:55.0286585Z ##[debug]INPUT_PROJECT: '07868441-2d65-4059-a97a-6b9050309297'
2020-11-30T16:12:55.0310728Z ##[debug]INPUT_BUILDDEFINITION (empty)
2020-11-30T16:12:55.0403088Z ##[debug]INPUT_RELEASEDEFINITION: 'chatbot'
2020-11-30T16:12:55.0404215Z ##[debug]INPUT_PIPELINE: 'Release'
2020-11-30T16:12:55.0412709Z ##[debug]INPUT_DESCRIPTION (empty)
2020-11-30T16:12:55.0436881Z ##[debug]INPUT_BRANCH (empty)
2020-11-30T16:12:55.0460169Z ##[debug]INPUT_BUILDNUMBER (empty)
2020-11-30T16:12:55.0488300Z ##[debug]INPUT_STAGES: 'dev'
2020-11-30T16:12:55.0494627Z ******************************
2020-11-30T16:12:55.0500793Z ** Service Connection: 9628c8c4-0a32-45dc-8b7d-xxxxxx
2020-11-30T16:12:55.0506850Z ** Release Url: https://vsrm.dev.azure.com/xxx
2020-11-30T16:12:55.0512949Z ** Organization Url: https://dev.azure.com/xxx
2020-11-30T16:12:55.0519964Z ** Token: ***
2020-11-30T16:12:55.0525005Z ** Project name: 07868441-2d65-4059-a97a-6b9050309297
2020-11-30T16:12:55.0531384Z ** Pipeline: Release
2020-11-30T16:12:55.0537416Z ** Build pipeline:
2020-11-30T16:12:55.0543452Z ** Release pipeline: chatbot
2020-11-30T16:12:55.0549422Z ** Description:
2020-11-30T16:12:55.0555259Z ** Branch:
2020-11-30T16:12:55.0561216Z ** BuildNumber:
2020-11-30T16:12:55.0567138Z ** Stages: dev
2020-11-30T16:12:55.0572939Z ******************************
2020-11-30T16:12:55.3035697Z ##[debug]GET https://vsrm.dev.azure.com/xxx/07868441-2d65-4059-a97a-6b9050309297/_apis/release/definitions?searchText=chatbot&$expand=environments&isExactNameMatch=true with 0-byte payload
2020-11-30T16:12:55.3728257Z ##[debug]received 5606-byte response of content type application/json; charset=utf-8; api-version=6.0
2020-11-30T16:12:55.4655652Z ##[debug]GET https://vsrm.dev.azure.com/xxx/07868441-2d65-4059-a97a-6b9050309297/_apis/Release/definitions/2 with 0-byte payload
2020-11-30T16:12:55.5165856Z ##[debug]received 25119-byte response of content type application/json; charset=utf-8; api-version=6.0
2020-11-30T16:12:55.6596067Z ##[debug]POST https://vsrm.dev.azure.com/xxx/07868441-2d65-4059-a97a-6b9050309297/_apis/release/releases?api-version=5.0-preview.8 with -1-byte payload
2020-11-30T16:12:55.8807805Z ##[debug]received 28832-byte response of content type application/json; charset=utf-8; api-version=5.0-preview.8
2020-11-30T16:12:55.8982243Z ##[debug]PATCH https://vsrm.dev.azure.com/xxx/07868441-2d65-4059-a97a-6b9050309297/_apis/release/releases/59/environments/178?api-version=6.1-preview.7 with -1-byte payload
2020-11-30T16:12:56.1821467Z ##[debug]Leaving D:\a_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1.
2020-11-30T16:12:56.2698307Z ##[debug]Caught exception from task script.
2020-11-30T16:12:56.2738580Z ##[debug]Error record:
2020-11-30T16:12:56.3266895Z ##[debug]D:\a_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run-release.ps1 : VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed.
2020-11-30T16:12:56.3278440Z ##[debug]At D:\a_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1:46 char:3
2020-11-30T16:12:56.3293100Z ##[debug]+ .\run-release.ps1 -OrganizationUrl $organizationUrl -ReleaseU ...
2020-11-30T16:12:56.3307407Z ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-11-30T16:12:56.3319064Z ##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
2020-11-30T16:12:56.3330534Z ##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,run-release.ps1
2020-11-30T16:12:56.3341815Z ##[debug]
2020-11-30T16:12:56.3360914Z ##[debug]Script stack trace:
2020-11-30T16:12:56.3952460Z ##[debug]at , D:\a_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run-release.ps1: line 107
2020-11-30T16:12:56.3953923Z ##[debug]at , D:\a_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1: line 46
2020-11-30T16:12:56.3964824Z ##[debug]at , : line 1
2020-11-30T16:12:56.3975241Z ##[debug]at , : line 22
2020-11-30T16:12:56.3985560Z ##[debug]at , : line 18
2020-11-30T16:12:56.4003852Z ##[debug]at , : line 1
2020-11-30T16:12:56.4009493Z ##[debug]Exception:
2020-11-30T16:12:56.4088473Z ##[debug]Microsoft.PowerShell.Commands.WriteErrorException: VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed.
2020-11-30T16:12:56.4340823Z ##[error]VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed.
2020-11-30T16:12:56.4351237Z ##[debug]Processed: ##vso[task.logissue type=error]VS402964: Transitioning of stage from state 'Queued' to state 'InProgress' is not allowed.
2020-11-30T16:12:56.4360212Z ##[debug]Processed: ##vso[task.complete result=Failed]
2020-11-30T16:12:56.4824948Z ##[section]Finishing: Trigger Azure DevOps Pipeline: Release

Best regards
Björn

@maikvandergaag
Copy link
Owner

It is availible for manual triggering stages

@JonTheStone
Copy link

Experiencing this same error. Confirmed pipeline is not running or being triggered by anything else. The interesting thing is that the task is triggering the release pipeline, but it is then failing saying it is running after it already started it

@maikvandergaag
Copy link
Owner

@JonTheStone what kind of trigger do you have configured? And could you share logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants