Bug 1694867 - strange build step error output
Summary: strange build step error output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.1.0
Assignee: Adam Kaplan
QA Contact: wewang
URL:
Whiteboard:
Depends On: 1695622
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-01 21:38 UTC by Ben Parees
Modified: 2019-06-04 10:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-04 10:46:50 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 None None None 2019-06-04 10:46:57 UTC
Red Hat Bugzilla 1695622 None CLOSED Buildah error message on failed dockerfile build contains unnecessary information 2019-06-20 06:04:23 UTC

Description Ben Parees 2019-04-01 21:38:42 UTC
Description of problem:
When an error occurs while building a dockerfile, the output looks like:

ERROR: logging before flag.Parse: F0401 21:06:20.657618       1 helpers.go:119] error: build error: error building at step {Env:[OPENSHIFT_BUILD_NAME=src-cache-origin-master-7 OPENSHIFT_BUILD_NAMESPACE=ci VERSION=1.10.3 GOCACHE=/go/.cache GOARM=5 GOPATH=/go GOROOT=/usr/local/go PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/go/bin OPENSHIFT_BUILD_SOURCE=https://github.com/openshift/release.git OPENSHIFT_BUILD_REFERENCE=master OPENSHIFT_BUILD_COMMIT=211cc73fadfdb150cf35d2edd5261898f004023e BUILD_LOGLEVEL=5 CLONEREFS_OPTIONS={"git_user_email":"ci-robot@openshift.io","git_user_name":"ci-robot","log":"/dev/null","refs":[{"org":"openshift","repo":"origin","base_ref":"master","base_sha":"0b751606e93258614555c506f9b3aaffefc57723","path_alias":"github.com/openshift/origin"}],"src_root":"/go"}] Command:add Args:[./clonerefs /clonerefs] Flags:[] Attrs:map[] Message:ADD ./clonerefs /clonerefs Original:ADD ./clonerefs /clonerefs}: error evaluating symlinks "/tmp/build/inputs/clonerefs": lstat /app: no such file or directory


The "logging before flag.Parse" and the actual failure to find the /app path hav e been reported as separate bugs, but the actual "error building at step {Env...." is also strange and should be improved.  This output looks like it would be useful for debugging (ie loglevel 4+) but it does not seem useful to a user, despite being output by default.  Can we make this output more consumable?  It seems like the "Message" part is what's really relevant here.




How reproducible:
Always

Steps to Reproduce:
1. Create a dockerfile that will fail due to an error in an ADD statement
2. Run the build
3. Look at the output

Actual results:
Cluttered/confusing message about what failed

Expected results:
Clean message about what went wrong in the ADD step

Comment 1 Adam Kaplan 2019-04-03 13:17:17 UTC
@bparees the error is bubbling up from buildah. Filed bug https://bugzilla.redhat.com/show_bug.cgi?id=1694867 for a true fix.

On the openshift/builder side we should capture the error, do we continue to bubble up or should we capture the error, log at debug level, then send a new error? Ex: "dockerfile build failed, see the build log for details."

Comment 2 Ben Parees 2019-04-03 13:45:56 UTC
I think we continue to bubble up because if i have a bad line in my Dockerfile i don't want to have to run at debug loglevels to see what it is.

Comment 3 Adam Kaplan 2019-04-03 13:48:19 UTC
correction - https://bugzilla.redhat.com/show_bug.cgi?id=1695622

Comment 4 Adam Kaplan 2019-04-04 15:40:19 UTC
Moving severity to low - this should not block 4.1 from GA release.

Comment 5 Adam Kaplan 2019-05-15 18:38:40 UTC
PR: https://github.com/openshift/builder/pull/67

This merged before code freeze.

Comment 7 wewang 2019-05-16 03:23:57 UTC
verified in version:
$ oc get clusterversion
NAME      VERSION                        AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.1.0-0.ci-2019-05-14-041751   True        False         42h     Cluster version is 4.1.0-0.ci-2019-05-14-041751

steps:
Check the log
  $oc new-build -D $'FROM centos:7\nADD no-exist-file .' --docker-image=centos:7
  $ oc logs -f build/centos-1

STEP 1: FROM centos@sha256:ca58fe458b8d94bc6e3072f1cfbd334855858e05e1fd633aa07cf7f82b048e66
STEP 2: ADD no-exist-file .
error: build error: error building at STEP "ADD no-exist-file .": no files found matching "/tmp/build/inputs/no-exist-file": no such file or directory

Comment 9 errata-xmlrpc 2019-06-04 10:46:50 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


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