azure-pipelines-tasks: [BUG]: UseDotnetV2 - Fails silently to download

New issue checklist

Task name

UseDotnet

Task version

2.246.1

Issue Description

It seems the task is silently stopping after attempting to download the zip containing a version of the .NET sdk and then continues onto the next step. I would expect this to either error and fail the task or to successfully log that it has downloaded the tool and extracted into the tool directory

The offending area of code that it seems to be exiting from is in the azure-pipelines-tool-lib repository noted here - https://github.com/microsoft/azure-pipelines-tool-lib/blob/41acd733ff90c8bbc02c42376f46800b794cdc99/tool.ts#L251

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

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows Server Latest/Ubuntu Latest

Relevant log output

Downloading: https://download.visualstudio.microsoft.com/download/pr/c1b355f8-c828-4d2d-a0f5-a0695834be68/2c7a7983c02bebffc071648658b33b73/dotnet-sdk-8.0.107-win-x64.zip
##[debug]destination C:\a\_temp\df4b4a33-ebde-4814-802e-b45b3bdd2674
##[debug]downloading
##[debug]Content-Length of downloaded file: 282187308
##[debug]creating stream
Finishing: Install .NET SDK


### Full task logs with system.debug enabled

<details>
  <pre> [REPLACE THIS WITH YOUR INFORMATION] </pre>
</details>


### Repro steps

_No response_

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 44
  • Comments: 30 (4 by maintainers)

Most upvoted comments

Hi everyone, we are currently releasing fixed task versions - 2.247.0 and 2.247.1 If you see them working in your pipeline, please share feedback if the issue is resolved in your case or let us know if you are still experiencing issues.

Thanks

Hi @DergachevE

Yes, please give the rollout a priority, this is terrible for a couple of days now.

Most of our Builds are failing because of that, and we have to rerun it manually. And the Workarounds are not really suitable for us.

Hi @DergachevE , could this issue be escalated? This is creating a huge impact in our dev teams unfortunately.

We have encountered the same issue on multiple pipelines and this is impacting our deliverables.

Could this please be escalated or priority elevated?

Thank you in advance

Thanks everyone for your patience! Looks like the issue was fixed so I am closing this issue, but feel free to re-open if needed.

@sicil1ano I understand your frustration. The team was working hard on the RC-ing the issue, but considering the fact that previous versions of the task also started failing (but were working before) we had to investigate a combination of factors. This took us more time to deliver the fix.

Thanks for raising this issue to us. The team will look into it and come with updates.

As per recent changes:

I can see this update for this task on the release listed in the repo : #20446 This PR introduces a new 2.246.2 task version which is not yet rolled out

Hi @DergachevE,

Thank you for recognizing this is an issue, but would it be possible to escalate the severity of this up a few notches?

We’re currently heavily affected by this issue, and it’s wrecking havoc across multiple pipelines. And given the nature of the issue and the multitude of responses to this thread, it’s hard to believe this isn’t negatively affecting a large set of your customers at the moment.

We have the same issue since yesterday:

Agent name: 'Hosted Agent'
Current agent version: '3.245.0'
Microsoft Windows Server 2022
Image: windows-2022
Version: 20240929.1.0
Downloading task: UseDotNet (2.246.1)

@JasonWhall it also happens / fails on MS Hosted, thus you could check also that box in the description:

  • Microsoft Hosted

Hi everyone, we are currently releasing fixed task versions - 2.247.0 and 2.247.1 If you see them working in your pipeline, please share feedback if the issue is resolved in your case or let us know if you are still experiencing issues.

Thanks

Hallelujah!

Sorry for my frustration, but sometimes I think we developers, users of these products, are not only paying users, but are also considered your QA. I don’t understand otherwise how it’s possible to roll out code that would work only 50% of the time or less, causing problems worldwide.

Hi @DergachevE and @KonstantinTyukalov!

We see builds failing due to the same issue. While I appreciate the provided workarounds, is there a way to escalate this issue to speed up a resolution?

Thank you.

Hi folks, as a quick workaround we suggest using the following scripts before the UseDotnet step execution:

for windows:

- powershell: |
    # your target dotnet version
    $version = "8.0.107"

    # your target install path
    $sdkInstallationPath = Join-Path $env:AGENT_TOOLSDIRECTORY dotnet

    $scriptUrl = "https://dot.net/v1/dotnet-install.ps1"
    $scriptPath = Join-Path  $env:AGENT_TEMPDIRECTORY dotnet-install.ps1
    Invoke-WebRequest -Uri $scriptUrl -OutFile "$scriptPath"

    & $scriptPath -Version $version -InstallDir $sdkInstallationPath -Verbose

    "$version" > "${sdkInstallationPath}\sdk\${version}.complete"

  condition: eq(variables['Agent.OS'], 'Windows_NT')

for linux & macos:

- bash: |
      # your target dotnet version
      version="8.0.107"

      # your target install path
      installationPath="$(Agent.ToolsDirectory)/dotnet"

      script_path="$(Agent.TempDirectory)/dotnet-install.sh"
      curl -o $script_path "https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh"
      chmod +x $script_path

      $script_path --version $version --install-dir $installationPath --verbose

      echo "$version" > "${installationPath}/sdk/${version}.complete"

  condition: ne(variables['Agent.OS'], 'Windows_NT')

With these scripts, UseDotnet task will find downloaded dotnet version and skip archive fetching.

!!! Please make sure version and installationPath variables in scripts are matching the UseDotnet task input values

It happens about 50% of the time for us. I see reverting to version 2.243.1 did not help a poster above. Perhaps reverting to an even earlier version would help?

Unfortunately the issue happens even with previous versions. We rolled back to 2.238.1 and still same problem, build failing 50% of the time. I guess we will just wait for a proper fix.

Thanks for raising this issue to us. The team will look into it and come with updates.

As per recent changes:

I can see this update for this task on the release listed in the repo : https://github.com/microsoft/azure-pipelines-tasks/pull/20446 This PR introduces a new 2.246.2 task version which is not yet rolled out

2.247.1 first run succeeded (will watch it). 15 minutes ago with 246.1 was failing.

First few builds using 2.247.1 were successful. Will report back once I have more data.

I rolled back to 2.243.1 which was working a few days / weeks ago and I have the same output of download not always waited without raising any error, so following tasks using dotnet are failing. But it’s a bit random, and when a task finally manage to download and extract the SDK, it can be reused on following jobs if there are on the same agent.

Same issue started today morning for our .NET builds on Self-Hosted agents.

Task         : Use .NET Core
Version      : 2.246.1