Use git as helm repo throws "does not appear to be a gzipped archive; got 'text/html; charset=utf-8'"

10/12/2020

I'm exploring various options to publish charts and referred How to add helm repo from an existing github project? to achieve it. But when I tried to install the chart, I got the error Error: file '/Users/my_home/Library/Caches/helm/repository/chart-1.0.0.tgz' does not appear to be a gzipped archive; got 'text/html; charset=utf-8'

Tried chart-releaser to publish the chart to git. In this case also getting the same error.

When I tried to do wget https://github.com/repo/charts/releases/download/app-1.0.0/chart-1.0.0.tgz content-type is text/html. What's going wrong in this case? How do I fix this issue?

-- Santosh Hegde
github
kubernetes
kubernetes-helm

3 Answers

5/15/2021

You need to ensure the .tgz file is downloadable.

For example:

This looks like a valid chart URL but not and when you try to download by clicking the URL. You will see this is not downloadable.

https://github.com/pantsel/konga/blob/master/charts/konga/konga-1.0.0.tgz 

So, you need a downloadable version of the URL like the following;

https://raw.githubusercontent.com/pantsel/konga/master/charts/konga/konga-1.0.0.tgz

Hope this will work for you.

-- hbceylan
Source: StackOverflow

10/13/2020

This is still a problem on helm 3.2.0 but fixed in 3.2.4. Helm charts with ".tgz" fail, but charts with some random extension like ".gzip" download successfully with helm. So install helm v3.2.4. Here you can find information how to install helm 3.2.4 - helm-3.2.4.

Please take a look: helm-chart-issue, helm-gzip.

-- Malgorzata
Source: StackOverflow

10/27/2020

In my case, GitHub is private repo and authentication is required to pull the charts.

What I was doing?

helm repo index CHART_NAME --url <Full URL to chart.tgz file>

But

helm repo add --username u_name --password token <name> https://github.com/raw/ORG/charts/master

will add the helm repo, but helm install <name> won't use the same git token passed in previous step.

How to fix it?

helm package <CHART_NAME> -u -d .deploy
helm repo index .

In this case, index.yaml will contain the relative URL to chart not absolute url.

Same auth tokens are used to fetch .tgz file as well while running helm install

-- Santosh Hegde
Source: StackOverflow