You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
wrussell1999
changed the title
exitCode is does not exist when task fails for io.kestra.plugin.scripts.shell.CommandsexitCode does not exist when task fails for io.kestra.plugin.scripts.shell.CommandsJun 13, 2024
@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
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 :
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: