Bug 1628789

Summary: Build log snippet has a replacement error
Product: OpenShift Container Platform Reporter: Clayton Coleman <ccoleman>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: low Docs Contact:
Priority: medium    
Version: 3.11.0CC: aos-bugs, jokerman, mmccomas, wzheng
Target Milestone: ---   
Target Release: 4.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: String parsing was not properly handled. Consequence: Build log contained garbage data. Fix: Properly handle string formatting. Result: Build log should contain only log output.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-04 10:40:35 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:
Embargoed:

Description Clayton Coleman 2018-09-14 01:41:30 UTC
Log Tail:	Pulled 2/2 layers, 100%!c(MISSING)omplete
		Extracting

		Pulling image golang:1.10.3 ...
		error: build error: no such image

The % in the log tail is being interpreted as a format string.

From api.ci.

Comment 1 Ben Parees 2018-09-14 01:51:31 UTC
Is that actually in the build object, or is that something oc describe is doing?

I suspect the latter.

Comment 2 Ben Parees 2018-09-14 01:52:58 UTC
appears to be caused by lib/describe/helpers.go formatString().

Could happen to any field that has a valid format string.

Comment 3 Juan Vallejo 2018-10-18 20:09:57 UTC
Origin PR: https://github.com/openshift/origin/pull/21304

Comment 4 Juan Vallejo 2018-10-29 02:05:32 UTC
Origin PR has merged.

Comment 6 Xingxing Xia 2018-12-03 10:18:43 UTC
Verified in v4.0.0-0.80.0.
oc set build-hook bc/ruby-ex --post-commit --script="echo '100%'; echo '100%'; for i in seq 20; do echo '100%'; done; /bin/notexist"

oc start-build ruby-ex

oc describe build # no error now
Log Tail:	100%
		sh: /bin/notexist: No such file or directory
		subprocess exited with status 127
		subprocess exited with status 127
		error: build error: error building at step {Env:[PATH=/opt... 20; do echo '100%'; done; /bin/notexist'}: exit status 127

Comment 10 errata-xmlrpc 2019-06-04 10:40:35 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, 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/RHBA-2019:0758