Earthly "SAVE ARTIFACT ... not found" in CI
SAVE ARTIFACT exports a path from the build container to the output. If the RUN steps never produced that path, or it lives somewhere else, BuildKit cannot find it and the solve fails.
What this error means
earthly fails with "failed to solve: ... /app/dist: no such file or directory" or "artifact not found" on a SAVE ARTIFACT line.
+build | SAVE ARTIFACT /app/dist AS LOCAL ./dist
Error: solve: failed to solve: failed to compute cache key: "/app/dist": not foundCommon causes
The build never created the path
A prior RUN was expected to produce the file or directory but did not, so the SAVE ARTIFACT source is missing.
Wrong working directory or path
The artifact exists under a different WORKDIR than the path you referenced, so the export path resolves to nothing.
How to fix it
Confirm the path exists in the container
- Add a
RUN ls -labefore SAVE ARTIFACT to print the directory. - Correct the source path to where the build actually writes output.
- Re-run the target and confirm the artifact exports.
RUN ls -la /app/dist
SAVE ARTIFACT /app/dist AS LOCAL ./distMatch WORKDIR to the output path
Ensure the build step and the SAVE ARTIFACT reference the same absolute path under the current WORKDIR.
How to prevent it
- Print the output directory before saving an artifact.
- Use absolute paths consistent with WORKDIR.
- Fail the build step if the expected output is missing.