简体   繁体   English

无法运行 Azure 管道“缺少一个任务。管道引用了一个名为‘缓存’的任务

[英]Unable to run Azure pipeline "A task is missing. The pipeline references a task called 'Cache'

I am setting up my fork of a Github project with the azure_pipeline.yaml configuration.我正在使用 azure_pipeline.yaml 配置设置 Github 项目的分支。 This seems to work just fine for everyone else in the community but when I setup the pipeline it gives me the following exception:这似乎对社区中的其他人都很好,但是当我设置管道时,它给了我以下异常:

A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'compile_ci_build', step ''.)
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'test_ci_build', step ''.)
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'e2e_ci_build', step ''.)

Specifically,具体来说,

[UPDATE] [更新]

I modified the jobs-templates.yml and commented out all steps with Cache@2 and it runs fine .我修改了jobs-templates.yml并用Cache@2注释掉了所有步骤,它运行良好

By design, Azure DevOps does not automatically make all tasks available when you run a pipeline.按照设计,当你运行管道时,Azure DevOps 不会自动使所有任务可用。

You have to add them manually as part of the pipeline.您必须手动添加它们作为管道的一部分。

'cache' is one such task. “缓存”就是这样一项任务。

I'm doing this in classic gui (non-yaml) mode as I find it easier to search for things But what you do is in your pipeline add a new task and in the task search box type 'cache'.我在经典 gui(非 yaml)模式下执行此操作,因为我发现搜索内容更容易但是您所做的是在管道中添加一个新任务并在任务搜索框中键入“缓存”。

This will bring up the task.这将调出任务。 Click Add to include it in the pipeline.单击添加以将其包含在管道中。

For more information on this I would recommend reading:有关这方面的更多信息,我建议阅读:

https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops

Was able to get this working eventually.最终能够使这个工作。

Apparently for my Azure account.显然是我的 Azure 帐户。 I am not allow to use Cache@2 .我不允许使用Cache@2 changing all lines with更改所有行

- task: Cache@2

to

- task: CacheBeta@1

resolves all my problem.解决了我所有的问题。

I do not see you added cache task in your pipeline from your git repo.我没有看到您从 git 存储库中在管道中添加了缓存任务。

It should look like the example here:它应该看起来像这里的例子:

variables:
  YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn

steps:
- task: Cache@2
  inputs:
    key: 'yarn | "$(Agent.OS)" | yarn.lock'
    restoreKeys: |
       yarn | "$(Agent.OS)"
       yarn
    path: $(YARN_CACHE_FOLDER)
  displayName: Cache Yarn packages

- script: yarn --frozen-lockfile

Source 来源

I was getting the same error A task is missing. The pipeline references a..我遇到了同样的错误A task is missing. The pipeline references a.. A task is missing. The pipeline references a.. on one of azure task, PublishCucumberReport@1 . A task is missing. The pipeline references a..PublishCucumberReport@1一项 azure 任务中A task is missing. The pipeline references a.. I resolved it by visiting https://marketplace.visualstudio.com/ and going to the task and then clicking on get free button, which installs it on your pipeline我通过访问https://marketplace.visualstudio.com/并转到任务然后单击get free按钮来解决它,该按钮将其安装在您的管道上

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 得到'一个任务丢失。 管道引用了一个名为“缓存”的任务。 Azure 管道中的错误 - Getting 'A task is missing. The pipeline references a task called 'Cache'.' error in Azure Pipeline Azure DevOps 管道任务等待另一个管道完成 - Azure DevOps pipeline task to wait to run for another pipeline to complete 在失败的任务上继续执行Azure Pipeline - Continue Azure Pipeline on failed task Azure Powershell代理任务管道 - Azure Powershell agent task pipeline 无法在已安装的 azure 构建管道中看到任务的添加选项 - Unable to see add option for the task in azure build pipeline that is already Installed Azure 管道重新运行失败的任务(不是整个阶段) - Azure pipeline re-run failed task (not entire stage) Azure 管道检查是否有任何构建在不同的 azure 管道任务中运行 - Azure Pipeline Check is any builds are running in different azure pipeline task 在 azure 任务上设置变量以传递 Azure 管道的另一个任务 - Set variable on azure task to pass another task of Azure pipeline 在管道中使用 PowerShell 任务 Sysprep 一个 Azure VM - Sysprep an Azure VM using PowerShell task in a pipeline 如何强制执行 Azure 管道构建任务? - How to make a Azure Pipeline Build task mandatory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM