huserben / TfsExtensions

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

error calling another pipeline from a classic pipeline #161

Closed geetikasharma26 closed 2 years ago

geetikasharma26 commented 3 years ago

Hey,

We are getting a generic error while calling a yaml pipeline( using this task) from a classic pipeline. Do we need extra setting for this task?

Following are the logs: 2021-02-05T22:03:09.6903866Z ##[debug]Evaluating condition for step: 'OCS Portal Basic E2E Tests' 2021-02-05T22:03:09.6905487Z ##[debug]Evaluating: succeeded() 2021-02-05T22:03:09.6906514Z ##[debug]Evaluating succeeded: 2021-02-05T22:03:09.6907609Z ##[debug]=> True 2021-02-05T22:03:09.6908065Z ##[debug]Result: True 2021-02-05T22:03:09.6908546Z ##[section]Starting: OCS Portal Basic E2E Tests 2021-02-05T22:03:09.7001072Z ============================================================================== 2021-02-05T22:03:09.7001342Z Task : Trigger Build 2021-02-05T22:03:09.7001771Z 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-02-05T22:03:09.7002200Z Version : 3.1.7 2021-02-05T22:03:09.7002364Z Author : Benjamin Huser 2021-02-05T22:03:09.7002526Z Help : 2021-02-05T22:03:09.7002732Z ============================================================================== 2021-02-05T22:03:10.2895334Z ##[debug]agent.TempDirectory=C:\Agents\Agent-9EF2A671_work_temp 2021-02-05T22:03:10.2921077Z ##[debug]loading inputs and endpoints 2021-02-05T22:03:10.2927106Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2021-02-05T22:03:10.2940239Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2021-02-05T22:03:10.2943865Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2021-02-05T22:03:10.2952698Z ##[debug]loading INPUT_AUTHENTICATIONMETHOD 2021-02-05T22:03:10.2999200Z ##[debug]loading INPUT_BLOCKINPROGRESSBUILDS 2021-02-05T22:03:10.3008167Z ##[debug]loading INPUT_BUILDDEFINITION 2021-02-05T22:03:10.3010173Z ##[debug]loading INPUT_BUILDPARAMETERS 2021-02-05T22:03:10.3012274Z ##[debug]loading INPUT_CANCELBUILDSIFANYFAILS 2021-02-05T22:03:10.3014668Z ##[debug]loading INPUT_CHECKBUILDSONCURRENTBRANCH 2021-02-05T22:03:10.3016774Z ##[debug]loading INPUT_DEFINITIONISINCURRENTTEAMPROJECT 2021-02-05T22:03:10.3019081Z ##[debug]loading INPUT_DELAYBETWEENBUILDS 2021-02-05T22:03:10.3021459Z ##[debug]loading INPUT_DEPENDENTONFAILEDBUILDCONDITION 2021-02-05T22:03:10.3023611Z ##[debug]loading INPUT_DEPENDENTONSUCCESSFULBUILDCONDITION 2021-02-05T22:03:10.3025945Z ##[debug]loading INPUT_DOWNLOADBUILDARTIFACTS 2021-02-05T22:03:10.3028154Z ##[debug]loading INPUT_DROPDIRECTORY 2021-02-05T22:03:10.3031260Z ##[debug]loading INPUT_ENABLEBUILDINQUEUECONDITION 2021-02-05T22:03:10.3032315Z ##[debug]loading INPUT_FAILTASKIFBUILDSNOTSUCCESSFUL 2021-02-05T22:03:10.3034777Z ##[debug]loading INPUT_FAILTASKIFCONDITIONSARENOTFULFILLED 2021-02-05T22:03:10.3038137Z ##[debug]loading INPUT_IGNORESSLCERTIFICATEERRORS 2021-02-05T22:03:10.3040446Z ##[debug]loading INPUT_INCLUDECURRENTBUILDDEFINITION 2021-02-05T22:03:10.3042281Z ##[debug]loading INPUT_QUEUEBUILDFORUSERTHATTRIGGEREDBUILD 2021-02-05T22:03:10.3044520Z ##[debug]loading INPUT_STOREINENVIRONMENTVARIABLE 2021-02-05T22:03:10.3046899Z ##[debug]loading INPUT_TREATPARTIALLYSUCCEEDEDBUILDASSUCCESSFUL 2021-02-05T22:03:10.3048962Z ##[debug]loading INPUT_USECUSTOMSOURCEVERSION 2021-02-05T22:03:10.3050996Z ##[debug]loading INPUT_USESAMEBRANCH 2021-02-05T22:03:10.3053128Z ##[debug]loading INPUT_USESAMESOURCEVERSION 2021-02-05T22:03:10.3055063Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISH 2021-02-05T22:03:10.3057358Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISHREFRESHTIME 2021-02-05T22:03:10.3071982Z ##[debug]loaded 28 2021-02-05T22:03:10.3102917Z ##[debug]Agent.ProxyUrl=undefined 2021-02-05T22:03:10.3103285Z ##[debug]Agent.CAInfo=undefined 2021-02-05T22:03:10.3105541Z ##[debug]Agent.ClientCert=undefined 2021-02-05T22:03:10.3115156Z ##[debug]Agent.SkipCertValidation=undefined 2021-02-05T22:03:10.3140536Z ##[debug]definitionIsInCurrentTeamProject=true 2021-02-05T22:03:10.3142863Z ##[debug]tfsServer=null 2021-02-05T22:03:10.3143154Z ##[debug]teamProject=null 2021-02-05T22:03:10.3146997Z ##[debug]buildDefinition=ocs-portal-basic-e2e-tests 2021-02-05T22:03:10.3154400Z ##[debug]ignoreSslCertificateErrors=false 2021-02-05T22:03:10.3154713Z ##[debug]queueBuildForUserThatTriggeredBuild=true 2021-02-05T22:03:10.3155730Z ##[debug]useSameSourceVersion=false 2021-02-05T22:03:10.3162581Z ##[debug]useCustomSourceVersion=false 2021-02-05T22:03:10.3162939Z ##[debug]customSourceVersion=null 2021-02-05T22:03:10.3163221Z ##[debug]useSameBranch=true 2021-02-05T22:03:10.3163507Z ##[debug]branchToUse=null 2021-02-05T22:03:10.3163789Z ##[debug]waitForQueuedBuildsToFinish=true 2021-02-05T22:03:10.3164219Z ##[debug]waitForQueuedBuildsToFinishRefreshTime=180 2021-02-05T22:03:10.3166051Z ##[debug]failTaskIfBuildsNotSuccessful=true 2021-02-05T22:03:10.3168075Z ##[debug]cancelBuildsIfAnyFails=false 2021-02-05T22:03:10.3173510Z ##[debug]treatPartiallySucceededBuildAsSuccessful=false 2021-02-05T22:03:10.3173885Z ##[debug]downloadBuildArtifacts=true 2021-02-05T22:03:10.3174232Z ##[debug]dropDirectory=C:\Agents\Agent-9EF2A671_work 2021-02-05T22:03:10.3174960Z ##[debug]storeInEnvironmentVariable=false 2021-02-05T22:03:10.3175285Z ##[debug]demands=null 2021-02-05T22:03:10.3176722Z ##[debug]queueid=null 2021-02-05T22:03:10.3181943Z ##[debug]buildParameters=environment: staging 2021-02-05T22:03:10.3182288Z ##[debug]delayBetweenBuilds=0 2021-02-05T22:03:10.3183605Z ##[debug]authenticationMethod=OAuth Token 2021-02-05T22:03:10.3183893Z ##[debug]username=null 2021-02-05T22:03:10.3184087Z ##[debug]password=null 2021-02-05T22:03:10.3185748Z ##[debug]enableBuildInQueueCondition=false 2021-02-05T22:03:10.3187919Z ##[debug]includeCurrentBuildDefinition=true 2021-02-05T22:03:10.3188837Z ##[debug]blockingBuildsList=null 2021-02-05T22:03:10.3190045Z ##[debug]blockInProgressBuilds=false 2021-02-05T22:03:10.3194966Z ##[debug]dependentOnSuccessfulBuildCondition=false 2021-02-05T22:03:10.3195250Z ##[debug]dependentBuildsList=null 2021-02-05T22:03:10.3195485Z ##[debug]dependentOnFailedBuildCondition=false 2021-02-05T22:03:10.3195753Z ##[debug]dependentFailingBuildsList=null 2021-02-05T22:03:10.3203487Z ##[debug]checkbuildsoncurrentbranch=false 2021-02-05T22:03:10.3204001Z ##[debug]failTaskIfConditionsAreNotFulfilled=false 2021-02-05T22:03:10.3228655Z Using current Team Project 2021-02-05T22:03:10.3229085Z Team Project: engineering with ID 2021-02-05T22:03:10.3229419Z Using current Collection Url 2021-02-05T22:03:10.3234465Z Server URL: 2021-02-05T22:03:10.3234711Z Using following Authentication Method: OAuth Token 2021-02-05T22:03:10.3234924Z Trying to fetch authentication token from system... 2021-02-05T22:03:10.3243336Z Using OAuth Access Token 2021-02-05T22:03:10.5927179Z Provided team project was guid. 2021-02-05T22:03:10.5928089Z Context is Release - using Release Environment Variables 2021-02-05T22:03:10.5928596Z Build shall be triggered for same user that triggered current Release: Mark Klobukov 2021-02-05T22:03:10.5929004Z Using same branch as source version: refs/pull/18272/merge 2021-02-05T22:03:10.5929358Z Will trigger build with following parameters: environment: staging 2021-02-05T22:03:10.8728152Z Found parameter environment with value: staging 2021-02-05T22:03:11.1000324Z Error during request (1/5) 2021-02-05T22:03:11.1000717Z Error message: Error: Could not queue the build because there were validation errors or warnings. 2021-02-05T22:03:11.1001031Z Will wait 1 seconds before retrying request... 2021-02-05T22:03:12.2315286Z Error during request (2/5) 2021-02-05T22:03:12.2315683Z Error message: Error: Could not queue the build because there were validation errors or warnings. 2021-02-05T22:03:12.2315995Z Will wait 2 seconds before retrying request... 2021-02-05T22:03:14.3666422Z Error during request (3/5) 2021-02-05T22:03:14.3666814Z Error message: Error: Could not queue the build because there were validation errors or warnings. 2021-02-05T22:03:14.3667126Z Will wait 4 seconds before retrying request... 2021-02-05T22:03:18.5077352Z Error during request (4/5) 2021-02-05T22:03:18.5078771Z Error message: Error: Could not queue the build because there were validation errors or warnings. 2021-02-05T22:03:18.5079146Z Will wait 8 seconds before retrying request... 2021-02-05T22:03:26.6522367Z Error during request (5/5) 2021-02-05T22:03:26.6523023Z Error message: Error: Could not queue the build because there were validation errors or warnings. 2021-02-05T22:03:26.6523422Z Will wait 16 seconds before retrying request... 2021-02-05T22:03:42.6547100Z ##[debug]task result: Failed 2021-02-05T22:03:42.6578912Z ##[error]Request failed after 5 tries - see error messages in the log 2021-02-05T22:03:42.6589376Z ##[debug]Processed: ##vso[task.issue type=error;]Request failed after 5 tries - see error messages in the log 2021-02-05T22:03:42.6591171Z ##[debug]Processed: ##vso[task.complete result=Failed;]Request failed after 5 tries - see error messages in the log 2021-02-05T22:03:42.6636971Z ##[section]Finishing: OCS Portal Basic E2E Tests

huserben commented 3 years ago

Hi @geetikasharma26

I think it shouldn't matter whether you call a yaml or classic pipeline (but i've never tried). The error Could not queue the build because there were validation errors or warnings is coming from the Azure DevOps Api, so nothing directly from the task seems to fail - the question is why.

I see you're running a release definition (Context is Release - using Release Environment Variables). There are certain constraints when doing that (see Known Issues), for example you must have a linked build artifact. Also if I got it right you want to trigger the build for a branch that is running for a PR - i've never tried this so far. I don't see why it wouldn't work, but it's perhaps something to explore - Would it be possible to try to run the build with another branch than for a PR to see whether this is causing the problem?

kevinshum commented 3 years ago

I ran into a similar issue, but realized that the yaml definition (for the outgoing pipeline I was trying to trigger) didn't exist in the branch that I was initially queueing from. So by the time it got to the second pipeline, it couldn't find the yaml file to run. Not sure if that's the same issue for your case.

ddanboyle commented 2 years ago

I ran into the same error, where a classic build is using this trigger task to trigger a separate yaml build.

To get this to run, I had to uncheck the following:

Use current source version for the triggered build Use a custom source version for the triggered build Use same source branch as triggered build

The default form has one of these checked by default.

In my case, the triggered build used a completely different set of source, so the notion of "use current source version" doesn't make sense.

huserben commented 2 years ago

As I did not hear anything from the original poster and there are some solutions proposed, I'll close the issue. If something pops up it can be opened again.