Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1695622 - Buildah error message on failed dockerfile build contains unnecessary information
Summary: Buildah error message on failed dockerfile build contains unnecessary informa...
Status: POST
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 4.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.1.0
Assignee: Tom Sweeney
QA Contact: weiwei jiang
Depends On:
Blocks: 1694867
TreeView+ depends on / blocked
Reported: 2019-04-03 13:12 UTC by Adam Kaplan
Modified: 2019-04-04 18:38 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

Description Adam Kaplan 2019-04-03 13:12:11 UTC
Description of problem: If buildah build-using-dockerfile fails during a step, the resulting error message is not clear:

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= OPENSHIFT_BUILD_REFERENCE=master OPENSHIFT_BUILD_COMMIT=211cc73fadfdb150cf35d2edd5261898f004023e BUILD_LOGLEVEL=5 CLONEREFS_OPTIONS={"git_user_email":"","git_user_name":"ci-robot","log":"/dev/null","refs":[{"org":"openshift","repo":"origin","base_ref":"master","base_sha":"0b751606e93258614555c506f9b3aaffefc57723","path_alias":""}],"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

Version-Release number of selected component (if applicable): 1.7.1

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: Error thrown (and reported in OpenShift builds) contains extraneous information that is not actionable

Expected results: An actionable error message, such as "error building step ADD: error evaluating symlinks "/tmp/build/inputs/clonerefs": lstat /app: no such file or directory"

Additional info: See also

Comment 1 Ben Parees 2019-04-03 13:48:09 UTC
As an additional suggestion:  dump what is currently being dumped if the loglevel is verbose.  When it's info, cut it down to something like what Adam proposed.

Comment 2 Tom Sweeney 2019-04-04 18:20:29 UTC
PR with proposed fix:

# buildah bud -t tom -f ~/Dockerfile.badadd .
STEP 1: FROM alpine
STEP 2: ADD reallybadfile /tmp
error building at STEP "ADD reallybadfile /tmp": no files found matching "/root/tsweeney/workspaces/buildah/src/": no such file or directory

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