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=https://github.com/openshift/release.git OPENSHIFT_BUILD_REFERENCE=master OPENSHIFT_BUILD_COMMIT=211cc73fadfdb150cf35d2edd5261898f004023e BUILD_LOGLEVEL=5 CLONEREFS_OPTIONS={"git_user_email":"ci-robot","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 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 https://bugzilla.redhat.com/show_bug.cgi?id=1694867
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.
PR with proposed fix: https://github.com/containers/buildah/pull/1482 Test: # 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/github.com/containers/buildah/reallybadfile": no such file or directory
Yes, this fix was part of the 1.8.1 bump that is with https://github.com/openshift/builder/pull/67. I don't think that PR has merged yet.
Just as a quick follow up, the PR with is fixed has merged now. (https://github.com/openshift/builder/pull/67)
Checked with bumped version v1.8.2, and work well now. # ../../containers/buildah/buildah --version buildah version 1.8.2 (image-spec 1.0.0, runtime-spec 1.0.0) # ../../containers/buildah/buildah bud -f ./Dockerfile . STEP 1: FROM busybox:latest STEP 2: ADD not_existing_file . error building at STEP "ADD not_existing_file .": no files found matching "/home/wjiang/go/src/github.com/openshift/origin/not_existing_file": no such file or directory ERRO[0000] exit status 1
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