actions / setup-dotnet

Set up your GitHub Actions workflow with a specific version of the .NET core sdk
MIT License
947 stars 470 forks source link

Broken Download Links #397

Closed JVBotelho closed 11 months ago

JVBotelho commented 1 year ago

Description: Just configured it to use with CodeQL in my .net 7 project and seems that the links to download the sdk are someway broken

Task version: 3.0.3

Platform:

Runner type:

Repro steps:
configure into CodeQL Analyser as follow: `...

jobs: analyze: name: Analyze runs-on: windows-latest permissions: actions: read contents: read security-events: write

strategy:
  fail-fast: false
  matrix:
    language: [ 'csharp' ]
    # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
    # Use only 'java' to analyze code written in Java, Kotlin or both
    # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
    # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
  uses: actions/checkout@v3

- name: Setup .NET Core SDK
  uses: actions/setup-dotnet@v3.0.3
  with:
     global-json-file: Glitched Cat API/global.json
- run: dotnet build '.\Glitched Cat API.sln'
  working-directory: Glitched Cat API

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
  uses: github/codeql-action/init@v2
  with:
    languages: ${{ matrix.language }}

    ...`

Expected behavior: download and install the sdk

Actual behavior: fail to install sdk

dotnet-install: Downloading from "primary" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404 Downloading from "primary" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404
dotnet-install: Downloading from "primary" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404 Downloading from "primary" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404
dotnet-install: Downloading from "primary" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404 Downloading from "primary" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404
dotnet-install: Downloading from "primary" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404 Downloading from "primary" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-sdk-7.0.0-win-x64.zip. Returned HTTP status code: 404 Downloading from "legacy" link has failed with error:
Uri: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip
StatusCode: 404
Error: Unable to download https://dotnetbuilds.azureedge.net/public/Sdk/7.0.0/dotnet-dev-win-x64.7.0.0.zip. Returned HTTP status code: 404
Exception: D:\a\_actions\actions\setup-dotnet\v3.0.3\externals\install-dotnet.ps1:[12](https://github.com/JVBotelho/Glitched-Cat-API/actions/runs/4389425231/jobs/7686953944#step:3:13)44
Line |
1[24](https://github.com/JVBotelho/Glitched-Cat-API/actions/runs/4389425231/jobs/7686953944#step:3:25)4 |      throw "Could not find `"$assetName`" with version = $($DownloadLi …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find ".NET Core SDK" with version = 7.0.0 Refer to: https://aka.ms/dotnet-os-lifecycle for information
     | on .NET support

Error: Failed to install dotnet 1. dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
panticmilos commented 1 year ago

hi @JVBotelho, thank you for the report. We will take a look at it :)

dmitry-shibanov commented 1 year ago

Hello @JVBotelho. Could you please attach link to the build or public repository to reproduce the issue ?

JVBotelho commented 1 year ago

sure @dmitry-shibanov , the repo is this: https://github.com/JVBotelho/Glitched-Cat-API

jesselve commented 1 year ago

We are having this same issue with attempting to use "actions/setup-dotnet" with version 4.8 or 4.8.1.

IvanZosimov commented 1 year ago

We are having this same issue with attempting to use "actions/setup-dotnet" with version 4.8 or 4.8.1.

Hi, @jesselve 👋 Sorry but setup-dotnet doesn't support installing .NET Framework SDKs.

IvanZosimov commented 1 year ago

Hi, @JVBotelho, sorry for the late response. The root cause of you issue is in the global.json file. Currently setup-dotnet provides a simple logic for resolving version out of global.json, namely it resolves the version from version key and mutate it if rollForward key is set to latestFeature. If rollForward key is set to any other option, the action doesn't mutate the version and supply it to the installer as is. As there is no exact version 7.0.0 of .NET available, the action failed. As a workaround I can suggest to change value in the rollForward key to latestFeature, or remove it completele and target some exact version of .NET SDK.

Negroove commented 1 year ago

We are having this same issue with attempting to use "actions/setup-dotnet" with version 4.8 or 4.8.1.

Hi @jesselve , you could solve it? because im facing the same issue

dsame commented 11 months ago

Hello @Negroove,

did the workaround https://github.com/actions/setup-dotnet/issues/397#issuecomment-1538041973 help?

dsame commented 11 months ago

Hello @Negroove, I am closing the issue because of the workaround provided, feel free to reopen it or create a new one in case the problem still exists.