Tilt: docker missing file errors are weird and confusing

Created on 3 Nov 2019  ยท  3Comments  ยท  Source: tilt-dev/tilt

The buildkit error messages have gotten really bad. They look like this:

foo         โ”Š     โ•Ž [6/8] COPY src/js/lib /opt/app/src/js/lib
foo         โ”Š     โ•Ž 
foo         โ”Š     โ•Ž ERROR IN: [6/8] COPY src/js/lib /opt/app/src/js/lib
foo         โ”Š     โ•Ž 
foo         โ”Š     โ•Ž ERROR IN: [1/8] FROM docker.io/library/node:10@sha256:dabc15ad36a9e0a95862fbdf6ffdad439edc20aa27c7f10456644464e3fb5f08
foo         โ”Š     โ•Ž 
foo         โ”Š     โ•Ž ERROR IN: [6/8] COPY src/js/lib /opt/app/src/js/lib
foo         โ”Š 
foo         โ”Š ERROR: ImageBuild: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/src/js/lib" not found: not found
foo         โ”Š got unexpected error during build/deploy: ImageBuild: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/src/js/lib" not found: not found
Build Failed: ImageBuild: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/src/js/lib" not found: not found

as reported in this comment. They're so bad that people are getting confused and think it's a Tilt bug.

We should clean up this error message. This might involve fixes to docker/buildkit upstream, or just working around it in Tilt, depending on how easy it is.

bug

Most helpful comment

In case it helps somebody in the future:

My .dockerignore had an entry for target (Rust's build directory) and I was getting errors about files in /var/lib/docker/tmp/buildkit-.../target/debug not existing.

Removing target from .dockerignore fixed the problem. The error messages are not helpful. Telling me something like "you are trying to COPY files from an ignored directory" would have helped immensely.

Not blaming tilt though. That's definitely on Docker.

All 3 comments

I can spot at least 4 things wrong with this error message:

1) The text "got unexpected error during build/deploy" is misleading. It implies that this is a Tilt error instead of a normal build failure.
2) The "failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key" are all internal buildkit details that should probably be unwrapped/stripped out
3) The tilt output isn't clearly identifying which step of the build failed
4) The error appears 3 times in different formats

FWIW all of the above bullets except the "failed to compute cache key" part and the end of #2 seem to apply to all build failures, not just missing file errors.

In case it helps somebody in the future:

My .dockerignore had an entry for target (Rust's build directory) and I was getting errors about files in /var/lib/docker/tmp/buildkit-.../target/debug not existing.

Removing target from .dockerignore fixed the problem. The error messages are not helpful. Telling me something like "you are trying to COPY files from an ignored directory" would have helped immensely.

Not blaming tilt though. That's definitely on Docker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DblK picture DblK  ยท  5Comments

jazzdan picture jazzdan  ยท  4Comments

bandrade picture bandrade  ยท  5Comments

dolsem picture dolsem  ยท  3Comments

jazzdan picture jazzdan  ยท  3Comments