microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

[BUG]: DownloadSecureFile - Object reference not set to an instance of an object #20357

Closed leonelvargas closed 2 weeks ago

leonelvargas commented 2 weeks ago

New issue checklist

Task name

No response

Task version

No response

Issue Description

Good afternoon,

Today we got the surprise that no YAML pipeline can download “tasks”. I show you that the same tasks were downloading this Saturday and now they are not.

Saturday: image

Today: image

I found a similar ticket: https://github.com/microsoft/azure-pipelines-tasks/issues/20356

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04

Relevant log output

Agent name: 'Hosted Agent'
Agent machine name: 'fv-az406-635'
Current agent version: '3.243.1'
Operating System
Ubuntu
22.04.4
LTS
Runner Image
Image: ubuntu-22.04
Version: 20240818.1.0
Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240818.1/images/ubuntu/Ubuntu2204-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240818.1
Runner Image Provisioner
2.0.382.1
Current image version: '20240818.1.0'
Agent running as: 'vsts'
##[debug]Triggering repository: xxxx. repository type: Bitbucket
Prepare build directory.
##[debug]Creating build directory: '/home/vsts/work/1'
##[debug]Delete existing artifacts directory: '/home/vsts/work/1/a'
##[debug]Creating artifacts directory: '/home/vsts/work/1/a'
##[debug]Delete existing test results directory: '/home/vsts/work/1/TestResults'
##[debug]Creating test results directory: '/home/vsts/work/1/TestResults'
##[debug]Creating binaries directory: '/home/vsts/work/1/b'
##[debug]Creating source directory: '/home/vsts/work/1/s'
Set build variables.
Download all required tasks.
Downloading task: DownloadSecureFile (1.244.1)
##[debug]Task 'DownloadSecureFile' has been downloaded into '/home/vsts/work/_tasks/DownloadSecureFile_2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b/1.244.1'.
##[error]Object reference not set to an instance of an object.
##[debug]System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.CheckIfTaskNodeRunnerIsDeprecated(IExecutionContext executionContext, TaskStepDefinitionReference task) in /mnt/vss/_work/1/s/src/Agent.Worker/TaskManager.cs:line 382
   at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, IEnumerable`1 steps) in /mnt/vss/_work/1/s/src/Agent.Worker/TaskManager.cs:line 100
   at Microsoft.VisualStudio.Services.Agent.Worker.JobExtension.InitializeJob(IExecutionContext jobContext, AgentJobRequestMessage message) in /mnt/vss/_work/1/s/src/Agent.Worker/JobExtension.cs:line 140

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

parameters:
- name: taskName
  default: ''
- name: secureFile
  default: ''

steps:
  - task: DownloadSecureFile@1
    name: ${{ parameters.taskName }}
    displayName: 'Downloading ${{ parameters.taskName }}'
    inputs:
      secureFile: '${{ parameters.secureFile }}'
willianantunes commented 2 weeks ago

It seems this PR solves it.