Azure / setup-helm

Github Action for installing Helm
MIT License
141 stars 48 forks source link

Error: Failed to download Helm from location https://get.helm.sh/helm-v1.2.1-linux-amd64.zip #99

Closed jsjoeio closed 2 years ago

jsjoeio commented 2 years ago

What happened?

Run azure/setup-helm@v3.3
Downloading v1.2.1
  Error: Error: Failed to download Helm from location https://get.helm.sh/helm-v1.2.1-linux-amd[6](https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478016380#step:4:7)4.zip

Version

Runner

Ubuntu 20.04.5

Relevant log output

##[debug]Evaluating condition for step: 'Install helm'
##[debug]Evaluating: (success() && (steps.changed-files.outputs.any_changed == 'true'))
##[debug]Evaluating And:
##[debug]..Evaluating success:
##[debug]..=> true
##[debug]..Evaluating Equal:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating Index:
##[debug]..........Evaluating steps:
##[debug]..........=> Object
##[debug]..........Evaluating String:
##[debug]..........=> 'changed-files'
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'outputs'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'any_changed'
##[debug]....=> 'true'
##[debug]....Evaluating String:
##[debug]....=> 'true'
##[debug]..=> true
##[debug]=> true
##[debug]Expanded: (true && ('true' == 'true'))
##[debug]Result: true
##[debug]Starting: Install helm
##[debug]Loading inputs
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run azure/setup-helm@v3.3

::group::Downloading v1.[2](https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478071781#step:4:2).1
Downloading v1.2.1
  ##[debug]isExplicit: 1.2.1
  ##[debug]explicit? true
  ##[debug]checking cache: /opt/hostedtoolcache/helm/1.2.1/x64
  ##[debug]not found
  ##[debug]Downloading https://get.helm.sh/helm-v1.2.1-linux-amd64.zip
  ##[debug]Downloading /home/runner/work/_temp/7[3](https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478071781#step:4:3)8081a7-2c00-[4](https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478071781#step:4:4)e8b-8118-a9822f6644a[5](https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478071781#step:4:5)
  ##[debug]Failed to download from "https://get.helm.sh/helm-v1.2.1-linux-amd[6](https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478071781#step:4:6)4.zip". Code(404) Message(Not Found)
  Error: Error: Failed to download Helm from location https://get.helm.sh/helm-v1.2.1-linux-amd64.zip
  ##[debug]Node Action run completed with exit code 1
  ##[debug]Finishing: Install helm

https://github.com/coder/code-server/actions/runs/3316135595/jobs/5478071781

uchinda-sph commented 2 years ago

facing the same issue

ethan-k commented 2 years ago

Faced the same issue but replaced azure/setup-helm with the below code for now

      - name: Install Helm
        run: |
          curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
dotrieutan commented 2 years ago

got same problem, the download link was updated or something ?

jmd9019 commented 2 years ago

Getting same problem

Adding version solved it

      - name: Helm installer
        uses: Azure/setup-helm@v3
        with:
          version: 'v3.10.1'
vdhpieter commented 2 years ago

They relied on the default ordering of the GH GQL api and that probably got changed...

Changing the query used here and loosing the reverse (why do that if the API can do it for you?): https://github.com/Azure/setup-helm/blob/b70d33f56dce95f7970896b826403d7c1bbe8a22/src/run.ts#L58-L73

query {      
  repository(name: "helm", owner: "helm") {
    releases(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) {
      nodes {
        tagName
      }
    }
  }
}

Maybe I find time to PR this, but if somebody wants to do it be my guest!

marcindabrowski commented 2 years ago

But even when an order is added some computation of the latest need to be done. The latest could be some patch for previous major/minor.

sverweij commented 2 years ago

@marcindabrowski / @vdhpieter we might want to use the isLatest attribute from the GitHub API for this. See - graphql/reference/objects#release.

So a slight modification to @vdhpieter 's query ...

query {
  repository(name: "helm", owner: "helm") {
    releases(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) {
      nodes {
        tagName
        isLatest
        isDraft
        isPrerelease
      }
    }
  }
}

... and then adapting the processing (ref: src/run.ts#L71-L75 might do the trick:

      // ...
      const latestValidRelease: string = repository.releases.nodes
         .find(
            ({tagName, isLatest, isDraft, isPreRelease}) => 
                isValidVersion(tagName) && isLatest && !isDraft && !isPreRelease
          )?.tagName

      if (latestValidRelease) return latestValidRelease
      // ...

Related: recent announcement that the meaning of the isLatest attribute has changed a bit since it was introduced.

Edit: PR #100 seems to fix this issue (even without the above suggestions). I've taken the liberty to leave above suggestions as review comments hoping I didn't violate any community conventions ...

OliverMKing commented 2 years ago

100 will be merged in and released shortly. That fixes this issue. Thanks everyone for the help!

ImRodry commented 2 years ago

The linked PR was merged but this still isn’t resolved, are we waiting for anything else?

vdhpieter commented 2 years ago

@ImRodry the PR (https://github.com/Azure/setup-helm/pull/100) is not yet merged

ImRodry commented 2 years ago

Ah ok was looking at https://github.com/clusterpedia-io/clusterpedia-helm/pull/15 Do you have an ETA for when that will be merged?

OliverMKing commented 2 years ago

This has been fixed and released in v3.4 (and v3). Please upgrade to one of these versions. Thanks!