boomerang-io / community

The Boomerang community, roadmap, planning, and architecture repository. The central place for information on joining, contributing, and governance.
https://useboomerang.io
Apache License 2.0
11 stars 0 forks source link

Output parameters not shown in case of task failure #363

Open florentinvintila opened 1 year ago

florentinvintila commented 1 year ago

Describe the bug

In the case of a task that is supposed to fail, for example the HTTP Task, where we have the http status codes that are failing (i.e. 404) and the task should return the status code and the “Response” but the task is not exiting with the status 0, it returns with an “exception”, exits with status 1 process.exit(1) While we see the task as failed in Flow, the parameters are not populated.

What project does this issue relate to?

Boomerang Flow

To Reproduce

Run any HTTP Advance Task for a URL that would return 404 as an HTTP Code.

Environment

No response

Additional Contenxt

Expected behavior Even when the task is failing the parameters should be shown if they are sent/ populated.

The file that may helped us with finding the reason why the parameters are not displayed was: https://github.com/boomerang-io/flow.service.controller/blob/main/src/main/java/io/boomerang/kube/service/TektonServiceImpl.java Line 502 Description: the try catch for the exception is prior to the parameters being populated. image image

tlawrie commented 1 year ago

Hi @florentinvintila so two things.

  1. Results not being populated if a task fails on non-zero exit code is actually Tekton-related logic. Tekton tracks it here: https://github.com/tektoncd/pipeline/issues/3749 and it is also tracked in TEP-0048 https://github.com/tektoncd/community/blob/main/teps/0048-task-results-without-results.md with what changes may be implemented to alter the current functionality.

  2. You can validate if the Flow issue is related and that this is the case by running the task and accessing the Results via the tkn CLI and seeing if they have been populated. If they haven't been populated on the result in Tekton, they won't make it to Flow.

tlawrie commented 1 year ago

Hey @amhudson @gchickma 👀

gchickma commented 1 year ago

@tlawrie In the case @florentinvintila has described this is not a failure in or by Tekton to execute the task, it is the task definition/logic itself wanting to set an overall failure state, i.e. the user has specified conditions on the task input parameters that evaluate the execution result to determine if it is an application error not a Tekton error per se.

So in our case with the Advanced HTTP task, the task will set output parameters on certain conditions and those include overall task failure states and it's these cases where we need to use the output parameters in further steps in the workflow, specifically what error message was generated inside the task.

Or, are we saying that irrespective of whether it is an application/task generated error or Tekton has returned an error attempting to run the task no output parameters in either case will be populated on the output parameter stack?

@florentinvintila Have I missed anything?

gchickma commented 1 year ago

Hey @tlawrie when you get a chance to review my latest post ... thx

gchickma commented 1 year ago

Hey @tlawrie just bugging you again ... :-)

tlawrie commented 1 year ago

As far as I understand it when the execution fails (i.e. the process of the container exit), this constitutes a failure, as per the link I mentioned earlier.

On failure, Tekton does not try to read/store Results.

AndreiOla commented 1 year ago

I think this PR would help us: https://github.com/tektoncd/pipeline/pull/5064 Not sure how we can show our interest in seeing this in the next release of Tekton.