Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

az pipelines run fails with Could not queue the build because there were validation errors or warnings #19784

Open animaxcg opened 3 years ago

animaxcg commented 3 years ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug az pipelines run fails for all calls made to existing pipelines

To Reproduce run the following

 az pipelines run --branch refs/heads/<branch>--commit-id <commit-id> --name <pipelineName> --project <projectId> --variables var1=val1 var2=val2 --debug --verbose
cli.azure.cli.core.azclierror: Could not queue the build because there were validation errors or warnings.
 # Or
 az pipelines run --branch refs/heads/<branch>--commit-id <commit-id> --id<pipelineId> --project <projectId> --variables var1=val1 var2=val2 --debug --verbose
cli.azure.cli.core.azclierror: Could not queue the build because there were validation errors or warnings.

Expected behavior It should call start a pipeline I can call it through the ADO ui like a charm

az --version
azure-cli                         2.21.0 *

core                              2.21.0 *
telemetry                          1.0.6

Extensions:
azure-devops                      0.18.0

Python location '/opt/az/bin/python3'
Extensions directory '~/.azure/cliextensions'

Python (Linux) 3.6.10 (default, Mar 19 2021, 05:58:22) 
[GCC 9.3.0]

Legal docs and information: aka.ms/AzureCliLegal

Additional context I know the org and everything else is fine as I can run everyother az pipeline command and get back a valid/expected response

Here is debug output:

msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: https://dev.azure.com:443 "POST /MyOrg/MyProjectId/_apis/build/Builds HTTP/1.1" 400 477
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","customProperties":{"ValidationResults":[{"result":"error","message":"Stage servicePipeline must contain at least one job with no dependencies."}]},"innerException":null,"message":"Could not queue the build because there were validation errors or warnings.","typeName":"Microsoft.TeamFoundation.Build.WebApi.BuildRequestValidationFailedException, Microsoft.TeamFoundation.Build2.WebApi","typeKey":"BuildRequestValidationFailedException","errorCode":0,"eventId":3000}'
msrest.exceptions: Could not queue the build because there were validation errors or warnings.
cli.azext_devops.dev.common.exception_handler: handling vsts service error
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 694, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 811, in default_command_handler
    return op(**command_args)
  File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/dev/pipelines/pipeline.py", line 139, in pipeline_run
    queued_build = client.queue_build(build=build, project=project)
  File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/v5_0/build/build_client.py", line 328, in queue_build
    content=content)
  File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 90, in _send
    response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
  File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 54, in _send_request
    self._handle_error(request, response)
  File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 233, in _handle_error
    raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: Could not queue the build because there were validation errors or warnings.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 660, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 723, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 715, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 18, in azure_devops_exception_handler
    raise CLIError(ex)
knack.util.CLIError: Could not queue the build because there were validation errors or warnings.
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @narula0781, @ashishonce, @romil07.

Issue Details
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62 **Describe the bug** az pipelines run fails for all calls made to existing pipelines **To Reproduce** run the following ``` az pipelines run --branch refs/heads/--commit-id --name --project --variables var1=val1 var2=val2 --debug --verbose cli.azure.cli.core.azclierror: Could not queue the build because there were validation errors or warnings. # Or az pipelines run --branch refs/heads/--commit-id --id --project --variables var1=val1 var2=val2 --debug --verbose cli.azure.cli.core.azclierror: Could not queue the build because there were validation errors or warnings. ``` **Expected behavior** It should call start a pipeline I can call it through the ADO ui like a charm ``` az --version azure-cli 2.21.0 * core 2.21.0 * telemetry 1.0.6 Extensions: azure-devops 0.18.0 Python location '/opt/az/bin/python3' Extensions directory '/home/jhale/.azure/cliextensions' Python (Linux) 3.6.10 (default, Mar 19 2021, 05:58:22) [GCC 9.3.0] Legal docs and information: aka.ms/AzureCliLegal ``` **Additional context** I know the org and everything else is fine as I can run everyother `az pipeline` command and get back a valid/expected response Here is debug output: ``` msrest.universal_http: Evaluate proxies against ENV settings: True urllib3.connectionpool: https://dev.azure.com:443 "POST /MyOrg/MyProjectId/_apis/build/Builds HTTP/1.1" 400 477 azext_devops.devops_sdk.client: Response content: b'{"$id":"1","customProperties":{"ValidationResults":[{"result":"error","message":"Stage servicePipeline must contain at least one job with no dependencies."}]},"innerException":null,"message":"Could not queue the build because there were validation errors or warnings.","typeName":"Microsoft.TeamFoundation.Build.WebApi.BuildRequestValidationFailedException, Microsoft.TeamFoundation.Build2.WebApi","typeKey":"BuildRequestValidationFailedException","errorCode":0,"eventId":3000}' msrest.exceptions: Could not queue the build because there were validation errors or warnings. cli.azext_devops.dev.common.exception_handler: handling vsts service error cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception: cli.azure.cli.core.util: Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 694, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in __call__ return self.handler(*args, **kwargs) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 811, in default_command_handler return op(**command_args) File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/dev/pipelines/pipeline.py", line 139, in pipeline_run queued_build = client.queue_build(build=build, project=project) File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/v5_0/build/build_client.py", line 328, in queue_build content=content) File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 90, in _send response = self._send_request(request=request, headers=headers, content=content, media_type=media_type) File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 54, in _send_request self._handle_error(request, response) File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 233, in _handle_error raise AzureDevOpsServiceError(wrapped_exception) azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: Could not queue the build because there were validation errors or warnings. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 660, in execute raise ex File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 723, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 715, in _run_job return cmd_copy.exception_handler(ex) File "/home/myUser/.azure/cliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 18, in azure_devops_exception_handler raise CLIError(ex) knack.util.CLIError: Could not queue the build because there were validation errors or warnings. ```
Author: animaxcg
Assignees: -
Labels: `Service Attention`, `customer-reported`, `DevOps`, `Pipelines`
Milestone: -
yonzhan commented 3 years ago

route to service team

animaxcg commented 3 years ago

Any update?