helm: Error: validation: chart.metadata is required when using --repo

I am trying to upgrade/install a chart in my cluster. I want to load the chart “on the fly” from a remote without configuring the repo beforehand (running this process on CI).

helm upgrade foo foo --install --repo https://someartifactory.example.com/some-helm-repo/ --username foo --password bar --version 0.5.0

For some reason I get

Error: validation: chart.metadata is required

Downloading the chart first and installing it from local .tgz is working as expected. Also it’s working installing it from a local configured repository. It seems to affect only the --repo approach.index.yaml from the repo seems fine also to me.

Output of helm version:

version.BuildInfo{Version:"v3.0.0-rc.1", GitCommit:"ee77ae3d40fd599445ebd99b8fc04e2c86ca366c", GitTreeState:"clean", GoVersion:"go1.13.3"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.1", GitCommit:"d647ddbd755faf07169599a625faf302ffc34458", GitTreeState:"clean", BuildDate:"2019-10-02T17:01:15Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.10", GitCommit:"37d169313237cb4ceb2cc4bef300f2ae3053c1a2", GitTreeState:"clean", BuildDate:"2019-08-19T10:44:49Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 26
  • Comments: 29 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Error: validation: chart.metadata is required

is the error message which is displayed if there’s no Chart.yaml file in the working directory. The issue can be reproduced with

cd $(mktemp -d)
helm dependency update

This should be improved by making helm say that Chart.yaml does not exist because that’s the cause for the error.

I’ve encountered the same issue and in my case having a local folder with the same name as the chart name was the root cause of the issue, looks like --repo will be ignored if helm find a local folder, but local folder doesn’t have the Chart.yaml file.

I was getting the same error when trying to install from a tgz file. The issue as it turned out was – helm was expecting the file name as “Chart.yaml” . However the way archive file was packaged , chart was packaged as “dir/Chart.yaml”. This was causing the mismatch failure “Chart.yaml” != “dir/Chart.yaml” leading to error Error: validation: chart.metadata is required

Chart.yaml must be named exactly like this. Chart.yml or chart.yaml will both throw said error.

@PCatinean, I raised a bug: #7862 and then created a PR to fix inline repo: #7874, hopefully it will be merged soon

/alive

@eladitzhakian could you also provide which version of helm you are using? And the version of elasticsearch chart by doing a helm search elasticsearch? This will help us debug the problem further 😄

well it’s still a bug… probably easy to fix too?

having a local folder with the same name as the chart

Glorious bug, it’s even more fun that it is not fixed yet )

/alive

I have pointed out on that issue that changing precedence order is a breaking change, and cannot be done until Helm 4: https://github.com/helm/helm/blob/master/CONTRIBUTING.md#semantic-versioning

I agree that --repo should take precedence… but the fact of the matter is that it does not, and never has. Changing it mid-stream would violate our SemVer constraints.

That covers only part of this issue’s surface area, so I am leaving this issue open for that, and will mark the #7862 bug as deferred until Helm 4.

@eladitzhakian ran into the same issue with a different install and argument order seemed to fix it.

$ helm install elastic/elasticsearch elastic # didn’t work $ helm install elastic elastic/elasticsearch # did work

@pniederlag I tried to reproduce this. The only way that worked was - creating a bad chart, one without Chart.yaml (chart metadata); then creating a tar ball using tar as helm package returned error. And then creating an index for it manually as using helm repo index also didn’t work for an invalid chart. And then I tried to run a command similar to what you provided -

$ helm upgrade test test --install --repo http://localhost:5000
Release "test" does not exist. Installing it now.
Error: validation: chart.metadata is required

and it gave the above error.

So with current experimentation and findings I can only say the chart was probably a bad chart. But you said downloading and installing from local tar ball worked and it also worked with an already configured repo. So, I’m confused, because if it worked that way, it means it wasn’t a bad chart.

Could you help us with more details to reproduce the error?