Bug 1628789 - Build log snippet has a replacement error
Summary: Build log snippet has a replacement error
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.1.0
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
Depends On:
TreeView+ depends on / blocked
Reported: 2018-09-14 01:41 UTC by Clayton Coleman
Modified: 2019-06-04 10:40 UTC (History)
4 users (show)

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.
Clone Of:
Last Closed: 2019-06-04 10:40:35 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:40:45 UTC

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

		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.


Note You need to log in before you can comment on or make changes to this bug.