huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
45 stars 22 forks source link

Could not queue the build #197

Closed scherici closed 2 years ago

scherici commented 2 years ago

Hello, I'm having issue try to trigger a pipeline that live in the same project collection BUT in a different repository. The error is "Could not queue the build because there were validation errors or warnings.". We are using hosted agents (AKS).

Here is the full log:

2021-12-15T17:36:04.7380057Z ##[debug]Evaluating condition for step: 'TriggerBuild'
2021-12-15T17:36:04.7390573Z ##[debug]Evaluating: SucceededNode()
2021-12-15T17:36:04.7391274Z ##[debug]Evaluating SucceededNode:
2021-12-15T17:36:04.7405581Z ##[debug]=> True
2021-12-15T17:36:04.7413210Z ##[debug]Result: True
2021-12-15T17:36:04.7462879Z ##[section]Starting: TriggerBuild
2021-12-15T17:36:04.7746744Z ==============================================================================
2021-12-15T17:36:04.7747641Z Task         : Trigger Build
2021-12-15T17:36:04.7748418Z Description  : This tasks allows to trigger a new Build (add it to the queue) as part of a Build Definition. It contains as well some conditions that can be applied, for example if the last build of certain definition was successful or not.
2021-12-15T17:36:04.7749028Z Version      : 3.2.2
2021-12-15T17:36:04.7749458Z Author       : Benjamin Huser
2021-12-15T17:36:04.7749979Z Help         : 
2021-12-15T17:36:04.7750266Z ==============================================================================
2021-12-15T17:36:04.7923840Z ##[warning]This task uses Node 6 execution handler, which will be removed March 31st 2022. If you are the developer of the task - please consider the migration guideline to Node 10 handler - https://aka.ms/migrateTaskNode10 (check this page also if you would like to disable Node 6 deprecation warnings). If you are the user - feel free to reach out to the owners of this task to proceed on migration.
2021-12-15T17:36:04.8235135Z ##[debug]Using node path: /azp/agent/externals/node/bin/node
2021-12-15T17:36:05.2015245Z ##[debug]agent.TempDirectory=/azp/agent/_work/_temp
2021-12-15T17:36:05.2019594Z ##[debug]loading inputs and endpoints
2021-12-15T17:36:05.2020969Z ##[debug]loading INPUT_DEFINITIONISINCURRENTTEAMPROJECT
2021-12-15T17:36:05.2022471Z ##[debug]loading INPUT_BUILDDEFINITION
2021-12-15T17:36:05.2023612Z ##[debug]loading INPUT_QUEUEBUILDFORUSERTHATTRIGGEREDBUILD
2021-12-15T17:36:05.2024814Z ##[debug]loading INPUT_IGNORESSLCERTIFICATEERRORS
2021-12-15T17:36:05.2025950Z ##[debug]loading INPUT_USESAMESOURCEVERSION
2021-12-15T17:36:05.2027074Z ##[debug]loading INPUT_USECUSTOMSOURCEVERSION
2021-12-15T17:36:05.2028196Z ##[debug]loading INPUT_USESAMEBRANCH
2021-12-15T17:36:05.2029335Z ##[debug]loading INPUT_BRANCHTOUSE
2021-12-15T17:36:05.2030475Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISH
2021-12-15T17:36:05.2031655Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISHREFRESHTIME
2021-12-15T17:36:05.2032887Z ##[debug]loading INPUT_FAILTASKIFBUILDSNOTSUCCESSFUL
2021-12-15T17:36:05.2034096Z ##[debug]loading INPUT_CANCELBUILDSIFANYFAILS
2021-12-15T17:36:05.2035306Z ##[debug]loading INPUT_TREATPARTIALLYSUCCEEDEDBUILDASSUCCESSFUL
2021-12-15T17:36:05.2036502Z ##[debug]loading INPUT_DOWNLOADBUILDARTIFACTS
2021-12-15T17:36:05.2037587Z ##[debug]loading INPUT_DROPDIRECTORY
2021-12-15T17:36:05.2038663Z ##[debug]loading INPUT_STOREINENVIRONMENTVARIABLE
2021-12-15T17:36:05.2039821Z ##[debug]loading INPUT_DELAYBETWEENBUILDS
2021-12-15T17:36:05.2040880Z ##[debug]loading INPUT_BUILDPARAMETERS
2021-12-15T17:36:05.2041997Z ##[debug]loading INPUT_AUTHENTICATIONMETHOD
2021-12-15T17:36:05.2043136Z ##[debug]loading INPUT_ENABLEBUILDINQUEUECONDITION
2021-12-15T17:36:05.2044279Z ##[debug]loading INPUT_INCLUDECURRENTBUILDDEFINITION
2021-12-15T17:36:05.2045401Z ##[debug]loading INPUT_BLOCKINPROGRESSBUILDS
2021-12-15T17:36:05.2046542Z ##[debug]loading INPUT_DEPENDENTONSUCCESSFULBUILDCONDITION
2021-12-15T17:36:05.2047741Z ##[debug]loading INPUT_DEPENDENTONFAILEDBUILDCONDITION
2021-12-15T17:36:05.2048935Z ##[debug]loading INPUT_CHECKBUILDSONCURRENTBRANCH
2021-12-15T17:36:05.2050175Z ##[debug]loading INPUT_FAILTASKIFCONDITIONSARENOTFULFILLED
2021-12-15T17:36:05.2051378Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2021-12-15T17:36:05.2052923Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2021-12-15T17:36:05.2054247Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2021-12-15T17:36:05.2055509Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2021-12-15T17:36:05.2057331Z ##[debug]loaded 30
2021-12-15T17:36:05.2058413Z ##[debug]Agent.ProxyUrl=undefined
2021-12-15T17:36:05.2059518Z ##[debug]Agent.CAInfo=undefined
2021-12-15T17:36:05.2060525Z ##[debug]Agent.ClientCert=undefined
2021-12-15T17:36:05.2061560Z ##[debug]Agent.SkipCertValidation=undefined
2021-12-15T17:36:05.2274738Z ##[debug]definitionIsInCurrentTeamProject=true
2021-12-15T17:36:05.2277105Z ##[debug]tfsServer=undefined
2021-12-15T17:36:05.2278560Z ##[debug]teamProject=undefined
2021-12-15T17:36:05.2281408Z ##[debug]buildDefinition=Chorus Life - Test framework
2021-12-15T17:36:05.2283019Z ##[debug]ignoreSslCertificateErrors=false
2021-12-15T17:36:05.2284636Z ##[debug]queueBuildForUserThatTriggeredBuild=true
2021-12-15T17:36:05.2286245Z ##[debug]useSameSourceVersion=false
2021-12-15T17:36:05.2287529Z ##[debug]useCustomSourceVersion=false
2021-12-15T17:36:05.2288824Z ##[debug]customSourceVersion=undefined
2021-12-15T17:36:05.2290197Z ##[debug]useSameBranch=false
2021-12-15T17:36:05.2314456Z ##[debug]branchToUse=main
2021-12-15T17:36:05.2316568Z ##[debug]waitForQueuedBuildsToFinish=true
2021-12-15T17:36:05.2318163Z ##[debug]waitForQueuedBuildsToFinishRefreshTime=60
2021-12-15T17:36:05.2319535Z ##[debug]failTaskIfBuildsNotSuccessful=true
2021-12-15T17:36:05.2320925Z ##[debug]cancelBuildsIfAnyFails=false
2021-12-15T17:36:05.2322396Z ##[debug]treatPartiallySucceededBuildAsSuccessful=false
2021-12-15T17:36:05.2323847Z ##[debug]downloadBuildArtifacts=true
2021-12-15T17:36:05.2325287Z ##[debug]dropDirectory=/azp/agent/_work
2021-12-15T17:36:05.2326750Z ##[debug]storeInEnvironmentVariable=false
2021-12-15T17:36:05.2328620Z ##[debug]demands=undefined
2021-12-15T17:36:05.2330024Z ##[debug]queueid=undefined
2021-12-15T17:36:05.2331347Z ##[debug]buildParameters=OS: Android
2021-12-15T17:36:05.2332834Z ##[debug]templateParameters=undefined
2021-12-15T17:36:05.2334153Z ##[debug]delayBetweenBuilds=0
2021-12-15T17:36:05.2335483Z ##[debug]authenticationMethod=OAuth Token
2021-12-15T17:36:05.2336752Z ##[debug]username=undefined
2021-12-15T17:36:05.2338104Z ##[debug]password=undefined
2021-12-15T17:36:05.2339416Z ##[debug]enableBuildInQueueCondition=false
2021-12-15T17:36:05.2341159Z ##[debug]includeCurrentBuildDefinition=true
2021-12-15T17:36:05.2342447Z ##[debug]blockingBuildsList=undefined
2021-12-15T17:36:05.2344035Z ##[debug]blockInProgressBuilds=false
2021-12-15T17:36:05.2393164Z ##[debug]dependentOnSuccessfulBuildCondition=false
2021-12-15T17:36:05.2394581Z ##[debug]dependentBuildsList=undefined
2021-12-15T17:36:05.2396075Z ##[debug]dependentOnFailedBuildCondition=false
2021-12-15T17:36:05.2397420Z ##[debug]dependentFailingBuildsList=undefined
2021-12-15T17:36:05.2398766Z ##[debug]checkbuildsoncurrentbranch=false
2021-12-15T17:36:05.2400131Z ##[debug]failTaskIfConditionsAreNotFulfilled=true
2021-12-15T17:36:05.2401141Z Using current Team Project
2021-12-15T17:36:05.2403432Z Team Project: Chorus life - Phase I with ID ad5b10ad-bae8-4f20-8469-3a18dd7e1fe9
2021-12-15T17:36:05.2405622Z Using current Collection Url
2021-12-15T17:36:05.2406965Z Server URL: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2021-12-15T17:36:05.2407913Z Using following Authentication Method: OAuth Token
2021-12-15T17:36:05.2408773Z Trying to fetch authentication token from system...
2021-12-15T17:36:05.2415044Z ##[debug]System.AccessToken=***
2021-12-15T17:36:05.2416149Z Using OAuth Access Token
2021-12-15T17:36:06.7532628Z Provided team project was guid.
2021-12-15T17:36:06.7536591Z Context is Build - using Build Environment Variables
2021-12-15T17:36:06.7546168Z Build shall be triggered for same user that triggered current build: XXXXXXXXXXXXXXXX
2021-12-15T17:36:06.7548547Z Will trigger build with following parameters: OS: Android
2021-12-15T17:36:06.7550578Z Will fail the task if a condition is not fulfilled.
2021-12-15T17:36:07.2384004Z Found parameter OS with value: Android
2021-12-15T17:36:07.6026673Z Error during request (1/5)
2021-12-15T17:36:07.6029346Z Error message: Error: Could not queue the build because there were validation errors or warnings.
2021-12-15T17:36:07.6069104Z Will wait 1 seconds before retrying request...
2021-12-15T17:36:09.3853438Z Error during request (2/5)
2021-12-15T17:36:09.3856110Z Error message: Error: Could not queue the build because there were validation errors or warnings.
2021-12-15T17:36:09.3857813Z Will wait 2 seconds before retrying request...
2021-12-15T17:36:12.2263523Z Error during request (3/5)
2021-12-15T17:36:12.2266368Z Error message: Error: Could not queue the build because there were validation errors or warnings.
2021-12-15T17:36:12.2268930Z Will wait 4 seconds before retrying request...
2021-12-15T17:36:16.7070172Z Error during request (4/5)
2021-12-15T17:36:16.7076239Z Error message: Error: Could not queue the build because there were validation errors or warnings.
2021-12-15T17:36:16.7077783Z Will wait 8 seconds before retrying request...
2021-12-15T17:36:25.0996769Z Error during request (5/5)
2021-12-15T17:36:25.0999112Z Error message: Error: Could not queue the build because there were validation errors or warnings.
2021-12-15T17:36:25.1009303Z ##[debug]task result: Failed
2021-12-15T17:36:25.1042069Z ##[error]Request failed after 5 tries - see error messages in the log
2021-12-15T17:36:25.1044952Z ##[debug]Processed: ##vso[task.issue type=error;]Request failed after 5 tries - see error messages in the log
2021-12-15T17:36:25.1060166Z ##[debug]Processed: ##vso[task.complete result=Failed;]Request failed after 5 tries - see error messages in the log
2021-12-15T17:36:25.1104951Z ##[section]Finishing: TriggerBuild

Here the "master" pipeline:

trigger: none

schedules:
- cron: '0 22 * * *' 
  displayName: 'Nightly build'
  branches:
    include:
    - 'feature/nightly'
  always: false 

pool:
  name: 'platform'

stages:
- stage: ExecuteTests
  displayName: 'Trigger automation test pipeline'
  jobs:
    - job: ExecutePipeline
      steps:
        - checkout: none          
        - task: TriggerBuild@3
          inputs:
            definitionIsInCurrentTeamProject: true
            buildDefinition: 'Chorus Life - Test framework'
            queueBuildForUserThatTriggeredBuild: true
            ignoreSslCertificateErrors: false
            useSameSourceVersion: false
            useCustomSourceVersion: false
            useSameBranch: false
            branchToUse: 'main'
            waitForQueuedBuildsToFinish: true
            waitForQueuedBuildsToFinishRefreshTime: '60'
            failTaskIfBuildsNotSuccessful: true
            cancelBuildsIfAnyFails: false
            treatPartiallySucceededBuildAsSuccessful: false
            downloadBuildArtifacts: true
            storeInEnvironmentVariable: false
            buildParameters: 'OS: Android'
            authenticationMethod: 'OAuth Token'
            enableBuildInQueueCondition: false
            dependentOnSuccessfulBuildCondition: false
            dependentOnFailedBuildCondition: false
            checkbuildsoncurrentbranch: false
            failTaskIfConditionsAreNotFulfilled: true

And here the triggered one:

parameters:
  - name: OS
    type: string
    displayName: Operating Systems
    default: Android
    values:
      - Android
      - iOS
      - ALL

trigger: none

stages:
  - ${{if eq(parameters.OS, 'Android')}}:
    - stage: ANDROID
      displayName: ANDROID
      jobs:
        - template: template.Android.yaml
  - ${{if eq(parameters.OS, 'iOS')}}:
    - stage: IOS
      displayName: IOS
      jobs:
        - template: template.iOS.yaml
  - ${{if eq(parameters.OS, 'ALL')}}:
    - stage: ALL
      displayName: ALL
      jobs:
        - template: template.ALL.yaml

As you can see, the child pipeline is based on models and exposes one parameter (actually it exposes many more parameters, but I remove them for simplicity). I try also to remove 'buildParameters' from the task but nothing change.

Can you please help me?

scherici commented 2 years ago

I beg your pardon, it really was an issue with the child pipeline (actually with one ot the template of the child pipeline).