Failed to download task 'Download' when using YAML Pipeline
See original GitHub issueRequired 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:
- Created 3 years ago
- Reactions:10
- Comments:12 (5 by maintainers)
Dude: I think I found the cause. When I have something like this:
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 changeCI
tocurrent
, 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 ofdownload
to install on the agent. SinceCI
does not exist, instead of failing with that error, it just defaults to version1.0.0
which does not exist. When I switch tocurrent
as the pipeline source, it succeeds at installing0.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: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.