Bug 1915898

Summary: TaskRun log output shows "undefined" in streaming
Product: OpenShift Container Platform Reporter: Christoph Jerolimov <cjerolim>
Component: Dev ConsoleAssignee: Christoph Jerolimov <cjerolim>
Status: CLOSED ERRATA QA Contact: Mohammed Saud <msaud>
Severity: low Docs Contact: Harsh Mishra <hmishra>
Priority: medium    
Version: 4.7CC: aballant, aos-bugs, msaud, nmukherj
Target Milestone: ---Keywords: UpcomingSprint
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
While running a Pipeline, the log tab of the `TaskRun` resource displayed the string as `undefined` after the command in the output. This was caused due to some edge cases where some internal string operations printed `undefined` to the log output. This issue has been fixed now, and the pipeline log output does not drop empty lines from the log stream and does not print the string `undefined` any longer.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:52:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
empty-line-in-pipeline-script.yaml none

Description Christoph Jerolimov 2021-01-13 16:55:48 UTC
Description of problem:
When running a Pipeline, the log tab of the TaskRun shows sometimes the string "undefined" after the command in the output.

This happen only sometimes and only while streaming the log. In my tests this only happen on the TaskRun detail page, not on the PipelineRun detail page.

When (re) loading a finished log the "undefined" string disappears and is shown as expected.

Version-Release number of selected component (if applicable):
OpenShift Pipelines Operator is installed (tested with 1.1.1)
OpenShift Console 4.7 master (commit 512bb95a3fbff309582496a4cbe608ffa3fe10de)

How reproducible:
Intermittent ~50 %

Steps to Reproduce:
1. Create a Pipeline with a task and a script, see attached yaml file.
2. Start the Pipeline and quickly open the TaskRun tab, select the TaskRun and open the logs tab.

Actual results:
Logs shows undefined after the command (not always)

+ node --versionundefined
v15.3.0
+ node --versionundefined
v15.3.0


Expected results:
No "undefined" string:

+ node --version
v15.3.0
+ node --version
v15.3.0


Additional info:
None

Comment 1 Christoph Jerolimov 2021-01-13 16:59:09 UTC
Created attachment 1747114 [details]
empty-line-in-pipeline-script.yaml

Comment 3 Mohammed Saud 2021-01-27 15:10:46 UTC
Verified on:
Version: 4.7.0-0.nightly-2021-01-27-072811
Browser: Firefox 84

TaskRun log shows properly without any unwanted text

Comment 6 errata-xmlrpc 2021-02-24 15:52:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633