microsoft / azure-pipelines-tasks

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

[BUG]: GoTool@0 doesn't support downloading Go 1.21 or above. #19690

Open matthchr opened 3 months ago

matthchr commented 3 months ago

New issue checklist

Task name

GoTool

Task version

0

Issue Description

GoTool tries to download all Golang releases from a path like: https://storage.googleapis.com/golang/go1.22.linux-amd64.tar.gz, but after Go 1.20 there are no longer published binaries at this path. Instead the URL https://golang.org/dl/ should be used, as you can see on the official Golang site: https://go.dev/dl/

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 latest

Relevant log output

Starting: Get Go 1.22
==============================================================================
Task         : Go tool installer
Description  : Find in cache or download a specific version of Go and add it to the PATH
Version      : 0.231.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/go-tool
==============================================================================
Downloading: https://storage.googleapis.com/golang/go1.22.linux-amd64.tar.gz
##[error]Failed to download version 1.22. Please verify that the version is valid and resolve any other issues. Error: Unexpected HTTP response: 404
    at Object.<anonymous> (/home/vsts/work/_tasks/GoTool_334727f4-9495-4f9d-a391-fc621d671474/0.231.0/node_modules/azure-pipelines-tool-lib/tool.js:216:31)
    at Generator.next (<anonymous>)
    at fulfilled (/home/vsts/work/_tasks/GoTool_334727f4-9495-4f9d-a391-fc621d671474/0.231.0/node_modules/azure-pipelines-tool-lib/tool.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  httpStatusCode: 404
}
Finishing: Get Go 1.22

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

- task: GoTool@0
      displayName: Get Go 1.22
      inputs:
        version: '1.22'
TrevorChristman commented 2 months ago

Hi, I'm having this problem also, and I'm unable to consume go 1.22.

Is there any workaround? Is there any schedule for correcting the GoTool step?

huliang-microsoft commented 2 months ago

I have the same issue, will this be fixed?

debben commented 1 month ago

I'm having a similar issue but I'm wondering if for the fix here, the download URL could be configurable either as an input or overridden with an environment variable. In my case I have an artifactory instance acting as a proxying cache for requests to https://storage.googleapis.com/golang/%s. Also, is it possible to support wildcarded versions (1.22.*) similar to some of the dotnet tasks? I frequently re-bake runner images and the way that installer works is to grab the highest patch version https://github.com/actions/runner-images/blob/584c7c0fef943495221b46033addefb6419ecb0f/images/ubuntu/toolsets/toolset-2204.json#L46C1-L48C25

RichardChen820 commented 1 month ago

I'm stumbling over the same problem, any plan to fix or workaround?

enzobrands commented 1 month ago

Adding the patch version (1.22.3) to the version variable does work, if that helps anyone.