question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to download task 'Download' when using YAML Pipeline

See original GitHub issue

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: DownloadPipelineArtifact

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

  • Server - Azure Pipelines or TFS on-premises? Azure Pipelines

    • If using TFS on-premises, provide the version: N/A

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number: Org: DemandCreationProgram Project: DC Program Team Pipeline: data-aggregator Id: 2126

  • Agent - Hosted or Private:

    • If using Hosted agent, provide agent queue name: windows-2019

Issue Description

During the job initialization, I get an error message that it failed to download the ‘Download’ task. I am trying to use the download keyword in my YAML pipeline file.

Task logs

2020-05-11T00:35:07.3809773Z ##[section]Starting: Initialize job
2020-05-11T00:35:07.3811067Z Agent name: 'Hosted Agent'
2020-05-11T00:35:07.3811409Z Agent machine name: 'fv-az677'
2020-05-11T00:35:07.3811619Z Current agent version: '2.168.2'
2020-05-11T00:35:07.3849602Z ##[group]Operating System
2020-05-11T00:35:07.3849854Z Microsoft Windows Server 2019
2020-05-11T00:35:07.3850024Z 10.0.17763
2020-05-11T00:35:07.3850149Z Datacenter
2020-05-11T00:35:07.3850279Z ##[endgroup]
2020-05-11T00:35:07.3850429Z ##[group]Virtual Environment
2020-05-11T00:35:07.3850620Z Environment: windows-2019
2020-05-11T00:35:07.3850783Z Version: 20200430.2
2020-05-11T00:35:07.3851066Z Included Software: https://github.com/actions/virtual-environments/blob/win19/20200430.2/images/win/Windows2019-Readme.md
2020-05-11T00:35:07.3851459Z ##[endgroup]
2020-05-11T00:35:07.3852316Z Current image version: '20200430.2'
2020-05-11T00:35:07.3858221Z Agent running as: 'VssAdministrator'
2020-05-11T00:35:07.3916335Z ##[debug]Triggering repository: data-aggregator. repository type: Git
2020-05-11T00:35:07.3922829Z Prepare build directory.
2020-05-11T00:35:07.4212393Z ##[debug]Creating build directory: 'd:\a\1'
2020-05-11T00:35:07.4214950Z ##[debug]Delete existing artifacts directory: 'd:\a\1\a'
2020-05-11T00:35:07.4217444Z ##[debug]Creating artifacts directory: 'd:\a\1\a'
2020-05-11T00:35:07.4219424Z ##[debug]Delete existing test results directory: 'd:\a\1\TestResults'
2020-05-11T00:35:07.4220107Z ##[debug]Creating test results directory: 'd:\a\1\TestResults'
2020-05-11T00:35:07.4225297Z ##[debug]Creating binaries directory: 'd:\a\1\b'
2020-05-11T00:35:07.4227498Z ##[debug]Creating source directory: 'd:\a\1\s'
2020-05-11T00:35:07.4270001Z Set build variables.
2020-05-11T00:35:07.4309002Z Download all required tasks.
2020-05-11T00:35:07.4438032Z Downloading task: DownloadPipelineArtifact (1.2.4)
2020-05-11T00:35:07.6583114Z ##[debug]Task 'DownloadPipelineArtifact' has been downloaded into 'd:\a\_tasks\DownloadPipelineArtifact_61f2a582-95ae-4948-b34d-a1b3c4f6a737\1.2.4'.
2020-05-11T00:35:08.3627274Z Downloading task: Download (1.0.0)
2020-05-11T00:35:08.4441489Z ##[warning]Failed to download task 'Download'. Error No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
2020-05-11T00:35:08.4454917Z ##[warning]Back off 27.339 seconds before retry.
2020-05-11T00:35:36.4269703Z ##[warning]Failed to download task 'Download'. Error No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
2020-05-11T00:35:36.4274058Z ##[warning]Back off 18.883 seconds before retry.
2020-05-11T00:35:55.3577240Z ##[error]No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
2020-05-11T00:35:55.3584302Z ##[debug]Microsoft.TeamFoundation.DistributedTask.WebApi.TaskDefinitionNotFoundException: No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentHttpClient.GetTaskContentZipAsync(Guid taskId, TaskVersion version, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, TaskStepDefinitionReference task)
   at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, IEnumerable`1 steps)
   at Microsoft.VisualStudio.Services.Agent.Worker.JobExtension.InitializeJob(IExecutionContext jobContext, AgentJobRequestMessage message)
2020-05-11T00:35:55.3597591Z ##[section]Finishing: Initialize job

## Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

Starting: Initialize job
Agent name: 'Hosted Agent'
Agent machine name: 'fv-az674'
Current agent version: '2.168.2'
Operating System
Virtual Environment
Current image version: '20200430.2'
Agent running as: 'VssAdministrator'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: DownloadPipelineArtifact (1.2.4)
Downloading task: Download (1.0.0)
##[warning]Failed to download task 'Download'. Error No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
##[warning]Back off 12.591 seconds before retry.
##[warning]Failed to download task 'Download'. Error No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
##[warning]Back off 24.588 seconds before retry.
##[error]No task definition found matching ID 30f35852-3f7e-4c0c-9a88-e127b4f97211 and version 1.0.0. You must register the task definition before uploading the package.
Finishing: Initialize job

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

22reactions
AArnottcommented, Jul 25, 2020

Dude: I think I found the cause. When I have something like this:

- download: CI
  artifact: some-artifact

It fails unless CI is in fact a defined resource in the pipeline. In my case, I had moved this step from one pipeline to another and forgot to change CI to current, so it was pointing at an invalid resource.

My guess is that Azure Pipelines wants to download the version of the task that matches the version of the tool used to upload it, so perhaps it tries to look up CI to get the version of download to install on the agent. Since CI does not exist, instead of failing with that error, it just defaults to version 1.0.0 which does not exist. When I switch to current as the pipeline source, it succeeds at installing 0.167.2.

So I think this is a case of a misleading error message when download is given the wrong inputs. It should have been this, in my case:

- download: current
  artifact: some-artifact
2reactions
alexgurmancommented, Nov 9, 2020

I am seeing the error when I use variables to specify download specs, using hard coded values works. Reported to Support team as a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

YAML task for download artifacts does not work with variable
Hi. I have been working in Azure Devops Services. I've added to my azure devops pipeline step to download artifact from CI pipeline....
Read more >
Azure pipelines errors out in Download Artifacts task
the DownloadArtirfacts task using very old node version (6) and the Dynatrace agent doesn't like it. To resolve it you have 2 options:...
Read more >
Download Pipeline Artifacts v2 task - Microsoft Learn
Use this task to download pipeline artifacts from earlier stages in this pipeline, ... Download artifacts from failed builds.
Read more >
Artifactory Azure DevOps Extension - JFrog Documentation
However, if your build agent does not have access to the internet, the build will fail when attempting to download the file. You'll...
Read more >
Create and Configure Jobs and Pipelines Using YAML
In DevCS, you can use a YAML file (a file with .yml extension) to store a job ... Click the View Error link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found