-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Failed TaskRuns should still report results #3439
Comments
Could you go in to a bit more detail as to why they should be included? What's your use-case? A failed Task may have failed because the data it generated was invalid. |
I'm using Tekton for execution, though the user-facing abstraction has no notion of Tekton concepts. When execution fails, I need to provide some details about this failure. I would like to store details about the failure in a result and then interrogate it when retreiving the PipelineRun. The only alternative I can think of is to access the logs directly, but this is undesirable. Having the user do it breaks encapsulation and doing it programatically requires access to the underlying Pods. |
yup I agree and would be great to provide a way to communicate failure logs which are otherwise just limited to the pod its running in. We have been having lot of discussion around task results in finally and task results without results, please feel free to leave a comment and voice your opinion: tektoncd/community#240 |
I dunno. I feel like we've jumped the gun a bit. I definitely see the value in returning some information about the failure of a Task. I'm not convinced that a Task Result is the absolutely only way we could tackle this tho. Here's an alternative: we add a new field to a TaskRun's status (e.g. Task Results already have a defined behaviour when Tasks fail - they don't populate in TaskRun Status. If we modify that contract I kinda feel like we're making a backwards-incompatible change. So I'm going to re-classify this as a feature request rather than a bug since Task Results aren't behaving incorrectly here - their behaviour matches the expectations we set for them when they were designed. Happy to discuss further but I think this needs to be considered a bit carefully before moving ahead on it. /kind feature |
Having a consistent way to populate a failure reason would be great. |
@ekupershlak we have stdout and stderr for steps being implemented, see TEP and PoC. Would this work for your use case? See issue #2925 |
@pritidesai if I understand correctly, that proposal simplifies capturing stdout/stderr of a step. This is useful, but doesn't provide a way to obtain this data. I tried to use a result because it's accessible from a TaskRun without any additional management (i.e. creating buckets or other similar stores). |
@ekupershlak @pritidesai So, any reason we cannot let a failed task report it's result? I have no idea about previous discussion about that, any clarification? @sbwsg |
We're essentially describing Results that are only optionally populated (i.e. they only populate when there's an error). Elsewhere we are proposing that a Task which doesn't emit a declared result should be an automatic failure: #3497. We've proposed this because users should be able to depend on Task Results so that other Tasks in a Pipeline can use them reliably. A missing Result should be considered a bug in a successful Task. So, let's look at an example Task with a failure result:
When this Task succeeds it must return a value for So I guess I'm still not that convinced that we need to muddy the contract around Results to support this. I'd personally prefer to see Results only returned on success and a different field returned on failure. See my earlier comment #3439 (comment) for a suggestion of a different possible way to tackle the same problem. |
Great discussion!!! Thanks @ekupershlak and @vincent-pli for going into detail about your use cases, this really helps. I'm thinking 2 things:
Is it possible that the user facing abstraction you are creating could access these logs? If the main problem is actually that it's difficult for you to fetch the logs, maybe we should tackle that directly. My thinking is that even if we DO add a failure reason or allow Tasks to emit results even when they fail, you're still going to need to write ALL of your Tasks in such a way that they are aware of their own failure and can introspect. That's going to be difficult to do since you'd need to handle the failure of ANY part of your Task. |
@bobcatfish This sums up the bulk of the issue: I was building an operator that, as part of reconciliation, is managing Tekton tasks. I could definitely add logic to read logs, but I was trying to avoid the work (and needing to add the corresponding permissions). I do think that there is room for error details to be distinct from logs. Tools can have noisy outputs (e.g. prompts for surveys), and STDERR is generally more valuable. Additionally, error detection in a script (e.g. checking if an output file is empty) could use |
@ekupershlak from the The reason I am asking is, we have a feature being designed to access the I agree with @sbwsg, |
@pritidesai I configured the tasks to emit results, but didn't specify any pipeline results. To get the value, I'm parsing Regarding a For what it's worth, I don't feel strongly about how error details are surfaced as long as there's a way. |
@bobcatfish thanks for your summary. and thanks @sbwsg for clarification One quick question about #3479 , I guess I like current behavior better: a task declare a I mean task 's From Actually, I have workaround the issue by parse the |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Expected Behavior
Results produced by failed steps should still be include in the task results.
Actual Behavior
Results are present in the "message" field of the step, but not in the task results.
Steps to Reproduce the Problem
Additional Info
v0.17.1 (I first ran into this in V16.3)
The text was updated successfully, but these errors were encountered: