Helm and Kubernetes: How to resolve Helm upgrade –install error “create: failed to create: the server responded with the status code 413 but did not return more information (post secrets)”
Helm upgrade --install fails install or upgrade of JFrog products with “create: failed to create: the server responded with the status code 413 but did not return more information (post secrets)” error
Affected Versions: Artifactory
When installing or upgrading Artifactory using Helm Charts, you will likely save the Chart pulled from the JFrog Helm repository and customize it as per your requirements.
When running the “helm upgrade” or the “helm upgrade –install” command, you may run into the following error message,
helm upgrade artifactory --namespace artifactory /opt/charts/artifactory -f /opt/charts/artifactory/values.yaml Error: UPGRADE FAILED: create: failed to create: the server responded with the status code 413 but did not return more information (post secrets)
Since no other message is displayed, it can be challenging to identify the underlying cause of the problem.
This issue can occur when the release data that’s kept in a secret gets too big (ref: secret size lmit). There may be some extra files, that are large and not used (e.g. old yaml files) in the Chart directory that are being included in the Chart data.
drwxr-xr-x@ 24 root root 768 Mar 10 12:04 . drwxr-xr-x@ 4 root root 128 Mar 10 10:33 .. -rw-r--r--@ 1 root root 6148 Mar 10 12:00 .DS_Store -rw-r--r--@ 1 root root 339 Sep 20 02:13 .helmignore -rw-r--r--@ 1 root root 44770 Sep 20 02:13 CHANGELOG.md -rw-r--r--@ 1 root root 217 Sep 20 02:13 Chart.lock -rw-r--r--@ 1 root root 658 Sep 20 02:13 Chart.yaml -rw-r--r--@ 1 root root 11357 Sep 20 02:13 LICENSE -rw-r--r--@ 1 root root 1997 Sep 20 02:13 README.md drwxr-xr-x@ 3 root root 96 Mar 10 10:33 charts drwxr-xr-x@ 11 root root 352 Mar 10 10:33 ci -rw-r--r--@ 1 root root 4192560 Mar 10 12:04 describe.txt drwxr-xr-x@ 6 root root 192 Mar 10 10:33 files drwxr-xr-x@ 3 root root 96 Mar 10 10:33 logo drwxr-xr-x@ 39 root root 1248 Mar 10 10:33 templates -rw-r--r--@ 1 root root 163 Sep 20 02:13 values-large.yaml -rw-r--r--@ 1 root root 162 Sep 20 02:13 values-medium.yaml -rw-r--r--@ 1 root root 162 Sep 20 02:13 values-small.yaml -rw-r--r--@ 1 root root 63728 Sep 20 02:13 values.yaml -rw-r--r--@ 1 root root 63728 Mar 10 10:47 values_old.yaml -rw-r--r--@ 1 root root 63728 Mar 10 10:47 values_old1.yaml -rw-r--r--@ 1 root root 63728 Mar 10 10:47 values_old2.yaml -rw-------@ 1 root root 3145729 Mar 10 11:59 values_test.yaml -rw-------@ 1 root root 3145850 Mar 10 11:59 values_test_old.yaml
ResolutionTo resolve this issue, you can either move unused files (e.g. from the above files list, you can remove old yaml files, large files like describe.txt that’s not needed for deployment) out of the Chart directory or use the .helmignore file. The .helmignore file is in the Chart root directory. You can create one if it’s not there already. Here is an example of the .helmignore file,
# Match any file or path named .helmignore .helmignore # Match any file or path named .git .git # Match any text file *.txt # Match only directories named mydir mydir/ # Match only text files in the top-level directory /*.txt # Match only the file foo.txt in the top-level directory /foo.txt # Match any file named ab.txt, ac.txt, or ad.txt a[b-d].txt # Match any file under subdir matching temp* */temp* */*/temp* temp?
With this file specified in the Chart directory, Helm will ignore all the files that match the pattern specified in the file while packaging your application.