travisghansen / argo-cd-helmfile

Integration between argo-cd and helmfile
MIT License
213 stars 55 forks source link

set -x eats etcd space #28

Closed cenkalti closed 1 year ago

cenkalti commented 1 year ago

When there is an error in a Helm chart, Argo saves the error message in following path:

image

That error message is a huge string because Helm chart and other stuff rendered into the script before executing. It was around 1 MB on a cluster I manage. Because Argo makes updates to the application definition continuously and etcd also keeps previous revisions of a key, this adds up quickly to fill the available space in etcd database. I cannot paste the whole thing here but the error message starts with

rpc error: code = Unknown desc = `argo-cd-helmfile.sh generate` failed exit status 1: + [[ -z generate ]]\n++ basename /usr/local/bin/argo-cd-helmfile.sh\n+ SCRIPT_NAME=argo-cd-helmfile.sh\n+ [[ -n '' ]]\n+ [[ -n '' ]]\n+ [[ -n '' ]]\n+ [[ -n '' ]]\n+ [[ -n /helm-working-dir ]]\n++ variable_expansion

and ends with

STDERR:\n  Error: failed to parse /tmp/helmfile1743267544/cenkalti-app2-values-191fc62d6a: error converting YAML to JSON: yaml: line 54: could not find expected ':'\n\nCOMBINED OUTPUT:\n  Error: failed to parse /tmp/helmfile2840360558/cenkalti-app2-values-191fc62d6a: error converting YAML to JSON: yaml: line 42: could not find expected ':'",

My suggestion is to remove

https://github.com/travisghansen/argo-cd-helmfile/blob/30b77b7a716a69d56d3f90ce340f86e6243a3ae3/src/argo-cd-helmfile.sh#L42

or comment out and add a comment to link to this issue.