Skip to content

Error: Failed to resolve the exact version number when using setup-dotnet action v4 #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
RelevanceRo opened this issue Apr 2, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@RelevanceRo
Copy link

RelevanceRo commented Apr 2, 2025

Description:
The setup-dotnet action always fails at downloading SDK for NET 9.0.x version with:

dotnet-install: Download attempt #1 has failed: Unable to download https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0/latest.version.
[52]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:53)dotnet-install: Attempt #2 will start in 10 seconds.
[53]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:54)dotnet-install: Download attempt #2 has failed: Unable to download https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0/latest.version.
[54]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:55)dotnet-install: Attempt #3 will start in 20 seconds.
[55]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:56)dotnet-install: Download attempt #1 has failed: Unable to download https://ci.dot.net/public/Sdk/9.0/latest.version.
[56]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:57)dotnet-install: Attempt #2 will start in 10 seconds.
[57]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:58)dotnet-install: Download attempt #2 has failed: Unable to download https://ci.dot.net/public/Sdk/9.0/latest.version.
[58]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:59)dotnet-install: Attempt #3 will start in 20 seconds.
[59]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:60)dotnet_install: Error: Failed to resolve the exact version number.
[60]blabla/actions/runs/4330378/job/15876247?pr=4#step:5:61)Error: Failed to install dotnet, exit code: 1. dotnet_install: Error: Failed to resolve the exact version number.

Task version:
v4

Platform:

  • [x ] Ubuntu
  • macOS
  • Windows

Runner type:

  • [x ] Hosted
  • Self-hosted

Repro steps:
Use setup-dotnet action v4 to download .NET 9.0.x

Expected behavior:
I expect the action to download and install the NET 9 SDK.

Actual behavior:
The setup-dotnet action always fails at downloading SDK for NET 9.0.x version with:
Error: Failed to install dotnet, exit code: 1. dotnet_install: Error: Failed to resolve the exact version number.

This is my action in the yml of CodeQL for my repo:

name: "CodeQL"
on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
  schedule:
    - cron: '41 10 * * 4'  # At 10:41 every Thursday

jobs:
  analyze:
    name: Analyze
    runs-on: [ ubuntu-latest ]
    timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'csharp' ]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
     
    # Initializes the CodeQL tools for scanning
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        languages: ${{ matrix.language }}
        # Query configuration
        queries: security-extended,security-and-quality
        # Configure CodeQL analysis options
        config: |
          # Configuration for all languages
          paths:
            - src
          paths-ignore:
            - '**/obj/**'
            - '**/bin/**'
            - '**/tests/**'
            - '**/*.Test*/**'
            - '**/*.Tests*/**'
         
          # C# specific configuration
          csharp:
            # Enable additional security analysis for database operations
            database-scrutiny: high
                 
          # Don't analyze test code
          query-filters:
            - exclude:
                tags contain: test    
    # Standard build using dotnet CLI
    - name: Setup .NET
      uses: actions/setup-dotnet@v4      
      with:        
        dotnet-version: '9.0.x'

    - name: Build with dotnet
      run: |
        dotnet restore BlaBla.Api.sln
        dotnet build BlaBla.Api.sln --configuration Debug --no-restore
       
    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v3
      with:
        category: "/language:${{matrix.language}}"
@RelevanceRo RelevanceRo added bug Something isn't working needs triage labels Apr 2, 2025
@aparnajyothi-y
Copy link
Contributor

Hello @RelevanceRo, Thank you for this issue and we will look into it :)

@chiranjib-swain chiranjib-swain self-assigned this Apr 3, 2025
@RelevanceRo
Copy link
Author

Hi, guys!

Seems that I have the same problem with dotnet-version: '8.0.x'

@chiranjib-swain
Copy link

Hello @RelevanceRo 👋,

I tried to reproduce the issue but the workflow ran successfully on my end. For your reference, here's the URL of the action runflow of the yml file: https://github.com/setup-actions-demo/test-setup-dotnet/actions/runs/14301032349/job/40075404776

To troubleshoot, please enable debugging for more detailed output by setting ACTIONS_STEP_DEBUG to true, as explained here: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging. The logs may provide more information about the issue.

Can you try re-running the workflow? If the problem continues, please share the specific action run of the workflow where the issue happens. Also, if you can, please provide a link to a minimal repository that reproduces the issue so we can investigate further.

Thank you for your cooperation! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants