helm fails with failed to create: Secret "sh.helm.release.v1.(release-name).v1" is invalid: data: Too long: must have at most 1048576 character

Viewed 14882

I am trying to install a helm release, using following command

helm upgrade --install --reset-values {release-name} ../chart --namespace test01 --values /tmp/values737957648

The chart is not packaged is kept in the expanded form.

This fails with the below error, where it basically trying to store release information

sh.helm.release.v1.{release-name}.v1" is invalid: data: Too long: must have at most 1048576 characters

How to go about debugging this problem?

if I try to generate the template of the chart and do kubectl create it gets installed fine .i.e.

helm template {release-name} chart --namespace test01 --values /tmp/values737957648 >> test1.yaml
kubectly create test1.yaml  (No configmap/No secret limit issue)

The problem occurs when trying to install via helm and it tries to create helm-secret

How could I approach to solve this issue ?

I am using helm version

helm version
version.BuildInfo{Version:"v3.0.2", GitCommit:"19e47ee3283ae98139d98460de796c1be1e3975f", 
GitTreeState:"clean", GoVersion:"go1.13.5"}
7 Answers

This answer is straight from: https://jhooq.com/helm-chart-failed-to-create/

The root cause behind this issue can be one of the following -

  1. Helm release name consists of upper-case (ex - helm install demoChart helloworld)
  2. Helm release name consists of blank spaces (ex - helm install demo Chart helloworld)
  3. Helm release name consists of special character (ex - helm install demoCh@rt helloworld)

In my case, I had underscore in my chart name. When I replaced underscores with dashes, chart deployed just fine.

in my case I had a "img/" directory with some images... at weekend I add many big png files... and a similar error appear...

% helm upgrade --install {release name} {mychart} -f values-mychart-custom.yaml --debug
    history.go:56: [debug] getting history for release mychart
    Release "mychart" does not exist. Installing it now.
    install.go:178: [debug] Original chart version: ""
    install.go:199: [debug] CHART PATH: Library/Caches/helm/repository/mychart-1.0.0.tgz

Error: create: failed to create: Secret "sh.helm.release.v1.mychart.v1" is invalid: data: Too long: must have at most 1048576 bytes
helm.go:88: [debug] Secret "sh.helm.release.v1.mychart.v1" is invalid: data: Too long: must have at most 1048576 bytes
create: failed to create
helm.sh/helm/v3/pkg/storage/driver.(*Secrets).Create
    helm.sh/helm/v3/pkg/storage/driver/secrets.go:164
helm.sh/helm/v3/pkg/storage.(*Storage).Create
    helm.sh/helm/v3/pkg/storage/storage.go:69
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
    helm.sh/helm/v3/pkg/action/install.go:340
main.runInstall
    helm.sh/helm/v3/cmd/helm/install.go:265
main.newUpgradeCmd.func2
    helm.sh/helm/v3/cmd/helm/upgrade.go:124
github.com/spf13/cobra.(*Command).execute
    github.com/spf13/cobra@v1.2.1/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
    github.com/spf13/cobra@v1.2.1/command.go:974
github.com/spf13/cobra.(*Command).Execute
    github.com/spf13/cobra@v1.2.1/command.go:902
main.main
    helm.sh/helm/v3/cmd/helm/helm.go:87
runtime.main
    runtime/proc.go:255
runtime.goexit
    runtime/asm_amd64.s:1581

after a loooong day doing an ugly Helm debug, I move the "img/" folder out of the chart directory and all working again....

so: please keep your awesome documentation and non-related Helm chart files outside the charts/* directories where you are developing your charts...

:)

The clue: generate manifest files, apply them and check all it's right

% helm template mychart chart --values ./values.yaml > debug.yaml
% kubectl apply -f debug.yaml
% kubectl delete -f debug.yaml

In my case the root cause was very unexpected: the chart folder contained the xxxx.tgz file (the archive file left there by mistake) and until it was deleted, I got this error all the time. The error message isn't even close to the real root cause.

I have faced a similar issue today and it was because I have some additional files in my helm directory.

ex: debug.log or my_readme.txt

I removed all the files that are not relevant to the helm chart and it worked fine.

Helm errors are misleading.

Move all files out of helm directory and then try to move them back in small chunks to see which folder/file contains this issue. Alternatively use du -sh $(ls -A) command to look for big folders or files.

Adding hidden .git directory into .helmignore file solved my issue with the same error message as in question title.

.helmignore content example:

*.txt
.git

I did an du . --block-size=KB and surprisingly there was a .kube folder which had a lot data in it, after removing that the problem solved.

Check, if you have any unused helm files in your helm chart folder. In my case I accidentally downloaded some big-size binary, and it caused similar issue.

Related