我如何克服“由于存在验证错误或警告而无法对构建进行排队。”使用 az-cli 自动创建管道

发布于 2025-01-19 18:30:51 字数 4196 浏览 2 评论 0原文

我正在尝试使用AZ-CLI自动创建Rsync管道。 这是我从存储库的本地克隆运行的命令:

az pipelines create --name my_pipeline --yml-path azure-pipeline.yml --project my_project --repository my_repo --repository-type tfsgit

创建管道,但无法排队。以下是 - 选开关的详细信息。我想念什么吗? 预期的输出不仅要创建管道,还要运行它。

** 警告:此命令在预览和开发中。

参考和支持级别: https://aka.ms/cli_refstatus 。

debug:cli.azext_devops.dev.common.common.exception_handler:处理VSTS服务错误

debug debug:cli.azure.cli.core.util:azure.cli.cli.core.util.util.handle.handle.handle_exception被称为例外:

debug:cli.azure.cli.core.util:Trackback(最新呼叫最后):

文件“ /USR/lib64/az/lib/python3.6/site-packages/azure/cli/core/core/cormands/commands- /< strong> init py“,第691行,in _run_job

结果= cmd_copy(params)

file” /USR/lib64/az/lib/lib/python3.6/site-packages/site-packages/ azure/cli/core/commands/ init .py”,第328行, call

*返回self.handler( *args, *args, * kwargs)

文件“/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/commands/command_operation.py”,第121行,在处理程序

中em>

file“/home/user/.azure/cliextensions/azure-devops/azext_devops/dev/pipelines/pipeline_create.py.py”,第155行,在pipeline_create中 project = project)

文件“/home/user/.azure/cliextensions/azure-devops/azext_devops/devops/devops_sdk/v5_1/build/build/build_client.py.py”,第337行,在queue_build content = content)

文件“/home/user/.azure/cliextensions/azure-devops/azext_devops/devops/devops_sdk/client.py.py”,第90行,in _send

wemplys wemplse = self.__send_request(replect = request = request = request = equest = headers = headers = headers = headers = headers = headers = headers = headers = headers = headers = headers = headers media_type = media_type)

文件“/home/user/.azure/cliextensions/azure-devops/azure-devops/azext_devops/devops/devops/devops_sdk/client.py.py”,第54行

,content = content , 请求,响应)

file“/home/user/.azure/cliextensions/azure-devops/azext_devops/devops/devops_sdk/client.py”,第233行,在_handle_error

azext_devops.devops_sdk.exceptions.azuredevopsserviceerror:由于存在验证错误或警告,因此无法排队构建。

在处理上述例外,发生了另一个例外:发生了另一个例外: Trackback(最近的最新通话):

文件“/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py

. args)

file“/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/commands/commands/pingstrong> init introng> py.py”,第657行,

提高ex

文件“/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/commands/commands/pingstrong> init> init .py”,第720行,在_run_jobs_seraly

results.append(self._run_job(expliented_arg,cmd_copy)))

file“/usr/lib64/az/lib/lib/python3.6/site-packages/site-packages/site-packages/azure/cli/cli/core/core/core/core/core/cormands/, init .py”,第712行,in _run_job

返回cmd_copy.exception_handler(ex)

file” /home/user/.azure/cliextensions/azure-devops/azure-devops/azzext_devops/azext_devops/devops/devops/devops/devops/devops/devops/devops/devops/devops/devops/devops/devops/dev /common/exception_handler.py”,第18行,在azure_devops_exception_handler

提高clierror(ex)

nack.util.util.util.util.util.util.clierror:无法排队构建,因为存在验证错误或警告。 >

错误:cli.azure.cli.core.azclierror:由于存在验证错误或警告,无法排队构建。

错误:az_command_data_logger:不能排队构建,因为有验证错误,或警告。

debug:cli.knack.cli:event: cli.postexecute [&lt; function azclilogging.deinit_cmd_metadata_logging at 0x7fe2e4afe2e4a682f0&gt

;

] main :命令在2.552秒内运行(init:0.200,Invoke:2.352)

信息:telemetry.save:Save temetry telemetry tementry长度3257在缓存

警告 中/.azure/telemetry.txt在2022-04-07 14:29:35.737231进行了修改,在小于600.000000 s

其他信息中,我正在设置azure_devops_ext_ext_ext_ext_ext_pat envibal enviality a i at az-cli ententicate和az-cli endenticate and az-cli命令。

I am trying to automate rsync pipeline creation using az-cli.
This is the command I am running from a local clone of my repository:

az pipelines create --name my_pipeline --yml-path azure-pipeline.yml --project my_project --repository my_repo --repository-type tfsgit

The pipeline is created but it is not able to queue it. Here are the details from the --debug switch. Am I missing something?
The expected output was to not only create the pipeline but also run it.

**WARNING: This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

WARNING: cli.azext_devops.dev.pipelines.pipeline_create: Successfully created a pipeline with Name: my_pipeline, Id: 2019.**

DEBUG: msrest.exceptions: Could not queue the build because there were validation errors or warnings.

DEBUG: cli.azext_devops.dev.common.exception_handler: handling vsts service error

DEBUG: cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:

DEBUG: cli.azure.cli.core.util: Traceback (most recent call last):

File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 691, in _run_job

result = cmd_copy(params)

File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 328, in call

*return self.handler(*args, *kwargs)

File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler

*return op(*command_args)

File "/home/user/.azure/cliextensions/azure-devops/azext_devops/dev/pipelines/pipeline_create.py", line 155, in pipeline_create
project=project)

File "/home/user/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/v5_1/build/build_client.py", line 337, in queue_build
content=content)

File "/home/user/.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/user/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 54, in _send_request

self._handle_error(request, response)

File "/home/user/.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 "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke

cmd_result = self.invocation.execute(args)

File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 657, in execute

raise ex

File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 720, in _run_jobs_serially

results.append(self._run_job(expanded_arg, cmd_copy))

File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 712, in _run_job

return cmd_copy.exception_handler(ex)

File "/home/user/.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.

ERROR: cli.azure.cli.core.azclierror: Could not queue the build because there were validation errors or warnings.

ERROR: az_command_data_logger: Could not queue the build because there were validation errors or warnings.

DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fe2e4a682f0>]

INFO: az_command_data_logger: exit code: 1

INFO: cli.main: Command ran in 2.552 seconds (init: 0.200, invoke: 2.352)

INFO: telemetry.save: Save telemetry record of length 3257 in cache

WARNING: telemetry.check: Negative: The /home/user/.azure/telemetry.txt was modified at 2022-04-07 14:29:35.737231, which in less than 600.000000 s

Additional information: I am setting the AZURE_DEVOPS_EXT_PAT env variable to authenticate and use az-cli commands.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隐诗 2025-01-26 18:30:52

错误消息说明了一切,它无法对构建进行排队,因为 YAML 中存在错误。

它创建了管道 2019,您需要在运行之前检查 YAML 并更正验证错误:

  1. 打开浏览器并导航到 https://dev.azure.com /<您的组织名称>/<您的项目名称>/_build?definitionId=2019

  2. 单击在编辑按钮上

  3. 在省略号上下文菜单中,选择验证:

    “”

有关无效语法的错误消息将显示在对话框中。

或者,Azure DevOps REST API 公开一个端点来执行相同的操作:

The error message says it all, it can't queue the build because there are errors in the YAML.

It created pipeline 2019, you need to review the YAML and correct the validation errors before it'll run:

  1. Open a browser and navigate to https://dev.azure.com/<your-organization-name>/<your-project-name>/_build?definitionId=2019

  2. Click on the Edit button

  3. In the elipsis context menu, select validate:

The error message about the invalid syntax will be shown in a dialog box.

Alternatively, the Azure DevOps REST API exposes an endpoint to do the same:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文