Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"}
like image 233
Ruchir Bharadwaj Avatar asked Oct 27 '20 12:10

Ruchir Bharadwaj


3 Answers

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/[email protected]/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
    github.com/spf13/[email protected]/command.go:974
github.com/spf13/cobra.(*Command).Execute
    github.com/spf13/[email protected]/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
like image 86
hejeroaz Avatar answered Oct 22 '22 11:10

hejeroaz


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.

like image 21
Mamun Avatar answered Oct 22 '22 09:10

Mamun


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.

like image 42
Ilya Yevlampiev Avatar answered Oct 22 '22 10:10

Ilya Yevlampiev