-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
exitCode
does not exist when task fails for io.kestra.plugin.scripts.shell.Commands
#4020
Comments
exitCode
is does not exist when task fails for io.kestra.plugin.scripts.shell.Commands
exitCode
does not exist when task fails for io.kestra.plugin.scripts.shell.Commands
@loicmathieu is this feasible? if so, how difficult would it be to persist outputs like this one in a failed task with allowFailure? I'm aware we discussed this in the past but I admit I no longer remember what was the decision here if not feasible, you can directly close and we can consider clarifying it in the Script docs |
similar request kestra-io/plugin-dbt#112 |
Yes, it's a refactoring that needs to be done on all script and CLI task to: in case of script exception, return the output with the exit code instead of throwing the exception, then set the task to FAIL. |
Scripts and CLI tasks should definitely handle this automatically, but as a temporary workaround for anyone dealing with this you can do something like this :
Works with script blocks as well, like this :
|
Describe the issue
When using
io.kestra.plugin.scripts.shell.Script
, it seems to only give the output exitCode if it succeeds. The example below doesn't generate exitCode so the second task fails.Unable to find exitCode used in the expression {{ outputs.task1.exitCode }} at line 1
It should return an
exitCode
when it fails andallowFailure
is set totrue
Seems to also be an issue for the SSH plugin: #4016
Environment
The text was updated successfully, but these errors were encountered: