[英]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,具体来说,
Here is my Azure pipeline link这是我的Azure 管道链接
azure-pipeline.yml
in the repoazure-pipeline.yml
tools/azure-pipelines/jobs-template.yml
tools/azure-pipelines/jobs-template.yml
参数化的tools/azure-pipelines/jobs-template.yml
[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
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.