maikvandergaag / msft-extensions

Repository for extensions mainly used for Azure DevOps Extensions
https://msftplayground.com
MIT License
126 stars 81 forks source link

Error Getting Build using Trigger Pipeline #443

Closed edleatherbury closed 1 year ago

edleatherbury commented 1 year ago

We are seeing an error when running the "Trigger Azure DevOps Pipeline" extension (version 1.1.10). We've used this extension for quite some time with no issues. This new error started occurring with no changes to either the target build or the Trigger Pipeline configuration.

The extension is used within one pipeline that triggers four separate builds, each their own pipeline. All four triggers use the same service connection. Three of the four triggers are working, just one is failing. The one that is failing targets an ubuntu-20.04 agent. The other three target windows-2022. That's the only difference in configuration.

Again, this configuration has run with no issues in the past, and just started failing last week (9/16/2022).

Log info

##[debug]Evaluating condition for step: 'Build - Event Processor'
##[debug]Evaluating: succeeded()
##[debug]Evaluating succeeded:
##[debug]=> True
##[debug]Result: True
Starting: Build - Event Processor
==============================================================================
Task         : Trigger Azure DevOps Pipeline
Description  : Build and Release Management task to trigger a Azure DevOps release or build pipeline.
Version      : 1.1.10
Author       : Maik van der Gaag
Help         : 
==============================================================================
##[debug]VstsTaskSdk 0.10.0 commit 787a46ec0a2df5b4d12c2e801bd3f319975c054c
##[debug]Entering D:\a\_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1.
##[debug]INPUT_CONNECTEDSERVICENAME: '9ca2404b-23c4-44b0-a0c7-ca623fc01e6c'
##[debug]ENDPOINT_URL_9ca2404b-23c4-44b0-a0c7-ca623fc01e6c: 'https://dev.azure.com/***'
##[debug]ENDPOINT_AUTH_9ca2404b-23c4-44b0-a0c7-ca623fc01e6c: '********'
##[debug]ENDPOINT_DATA_9ca2404b-23c4-44b0-a0c7-ca623fc01e6c: '{"releaseUrl":"https://vsrm.dev.azure.com/***"}'
##[debug]INPUT_PROJECT: '68b1d190-f7f5-4e12-ad23-bd95adbd72b3'
##[debug]INPUT_BUILDDEFINITION: 'Event Processor'
##[debug]INPUT_RELEASEDEFINITION (empty)
##[debug]INPUT_PIPELINE: 'Build'
##[debug]INPUT_DESCRIPTION (empty)
##[debug]INPUT_BRANCH: 'refs/heads/integration'
##[debug]INPUT_BUILDNUMBER (empty)
##[debug]INPUT_STAGES (empty)
******************************
** Organization Url: https://dev.azure.com/***
** Token: ***
** Project name: 68b1d190-f7f5-4e12-ad23-bd95adbd72b3
** Pipeline: Build
** Build pipeline: Event Processor
** Release pipeline: 
** Description: 
** Branch: refs/heads/integration
** BuildNumber: 
** Stages: 
******************************
##[debug]GET https://dev.azure.com/***/68b1d190-f7f5-4e12-ad23-bd95adbd72b3/_apis/build/definitions?name=Event Processor with 0-byte payload
##[debug]received 5059-byte response of content type application/json; charset=utf-8; api-version=7.0
##[debug]Leaving D:\a\_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1.
##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]D:\a\_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run-build.ps1 : Problem occured while getting the build
##[debug]At D:\a\_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1:43 char:3
##[debug]+         .\run-build.ps1 -OrganizationUrl $organizationUrl -AzureDevOp ...
##[debug]+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug]    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
##[debug]    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,run-build.ps1
##[debug] 
##[debug]Script stack trace:
##[debug]at <ScriptBlock>, D:\a\_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run-build.ps1: line 65
##[debug]at <ScriptBlock>, D:\a\_tasks\TriggerPipeline_05485ce0-4948-481c-a89f-f21fa2fe9a74\1.1.10\run.ps1: line 43
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]Microsoft.PowerShell.Commands.WriteErrorException: Problem occured while getting the build
##[error]Problem occured while getting the build
##[debug]Processed: ##vso[task.logissue type=error]Problem occured while getting the build
##[debug]Processed: ##vso[task.complete result=Failed]
Finishing: Build - Event Processor
maikvandergaag commented 1 year ago

Could you elaborate more? And is the problem still occurring?

edleatherbury commented 1 year ago

Yes, the problem is still occurring. Here is a synopsis: We have a build pipeline for a single app that runs on an ubuntu-20.04 agent. When that pipeline is executed by itself (not using the Trigger Azure DevOps Pipeline extension) it completes successfully. That build pipeline is also part of a second build pipeline that is triggered by the Trigger Azure DevOps Pipeline extension. That second pipeline has worked for a long time, but started failing several weeks ago. It only fails for the one ubuntu-20.04 build. It fails with the error posted in my original post.

maikvandergaag commented 1 year ago

The extension self on wich kind of agent does it run?

edleatherbury commented 1 year ago

It runs on a windows-22 agent.

maikvandergaag commented 1 year ago

@edleatherbury sorry for the late response. Was there maybe a change in the naming of the build pipeline? or access rights.

edleatherbury commented 1 year ago

No changes of that sort. I looked into this again today and tried something new. I deleted the step that was failing and re-added it to the pipeline. By default it was added as Task Version 2.*. Previous version (and the version for steps that are not failing) was 1.*.

I saved it, ran it, and it completed with no errors. Still don't know why it started failing, but it is resolved now. Thanks.

maikvandergaag commented 1 year ago

Great to here