-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better debugging/error output when using exec
filter
#1158
Comments
Enhances Helmfile to print more helpful message on error while calling `exec` template function. Helmfile has been printing error messages like the below: ``` in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sha" (list)>: error calling exec: exit status 1 ``` Adding captured stdout and stderr, with some indentation to make it readable, it now produces the following message on missing executable: ``` $ make build && ./helmfile build go build in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sha" (list)>: error calling exec: fork/exec ./exectest.sha: no such file or directory COMMAND: ./exectest.sha ERROR: fork/exec ./exectest.sha: no such file or directory ``` On non-zero exit status without output: ``` $ make build && ./helmfile build go build in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sh" (list)>: error calling exec: exit status 1 COMMAND: ./exectest.sh ERROR: exit status 1 ``` On non-zero exit status with output: ``` $ make build && ./helmfile build go build in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sh" (list)>: error calling exec: exit status 2 COMMAND: ./exectest.sh ERROR: exit status 2 COMBINED OUTPUT: out1 err1 ``` Resolves #1158
Enhances Helmfile to print more helpful message on error while calling `exec` template function. Helmfile has been printing error messages like the below: ``` in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sha" (list)>: error calling exec: exit status 1 ``` Adding captured stdout and stderr, with some indentation to make it readable, it now produces the following message on missing executable: ``` $ make build && ./helmfile build go build in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sha" (list)>: error calling exec: fork/exec ./exectest.sha: no such file or directory COMMAND: ./exectest.sha ERROR: fork/exec ./exectest.sha: no such file or directory ``` On non-zero exit status without output: ``` $ make build && ./helmfile build go build in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sh" (list)>: error calling exec: exit status 1 COMMAND: ./exectest.sh ERROR: exit status 1 ``` On non-zero exit status with output: ``` $ make build && ./helmfile build go build in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sh" (list)>: error calling exec: exit status 2 COMMAND: ./exectest.sh ERROR: exit status 2 COMBINED OUTPUT: out1 err1 ``` Resolves #1158
@ggillies Thanks! The error reporting is updated via #1159. Could you try the latest Helmfile release and confirm if you like it? I have been considering But after almost a year or two spending time supporting people using Helmfile, it turns out that, in practice, |
@mumoshu thanks so much for turning this around so quickly! What you have is perfect for us! Thanks again! |
Currently when you have a templating error due to something being invoked by
exec
, the error message you get back contains the command that was run and the return code of the command, but doesn't give you much more information than that to help debug.It would be really good if upon exec failure (e.g. non-zero exit code), the error message that comes back also contains the
stout
andstderr
text from the command that was run, in order to assist debugging.Alternatively/additionally, it would be good when running helmfile with
--log-level debug
to instead display a log message showingexec
commands being run, along with theirstdout
andstderr
.The text was updated successfully, but these errors were encountered: