failed to compute cache key

Hi, im trying to deploy a project in rust from github, but the deployment fails. this is the error:
#16 [stage-1 5/5] COPY --from=0 /app/bin/gen-t-api /app/bin/gen-t-api
#16 ERROR: failed to calculate checksum of ref moby::rgaiugj6nyskn2jsveh6l5b21: failed to walk /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: lstat /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: no such file or directory

-----
> [stage-1 5/5] COPY --from=0 /app/bin/gen-t-api /app/bin/gen-t-api:
-----

Dockerfile:28
-------------------
26 | COPY --from=0 /etc/ssl/certs /etc/ssl/certs
27 | RUN true
28 | >>> COPY --from=0 /app/bin/gen-t-api /app/bin/gen-t-api
29 | CMD ["cargo run -r"]
30 |
-------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref moby::rgaiugj6nyskn2jsveh6l5b21: failed to walk /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: lstat /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: no such file or directory

Error: Docker build failed
#16 [stage-1 5/5] COPY --from=0 /app/bin/gen-t-api /app/bin/gen-t-api
#16 ERROR: failed to calculate checksum of ref moby::rgaiugj6nyskn2jsveh6l5b21: failed to walk /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: lstat /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: no such file or directory

-----
> [stage-1 5/5] COPY --from=0 /app/bin/gen-t-api /app/bin/gen-t-api:
-----

Dockerfile:28
-------------------
26 | COPY --from=0 /etc/ssl/certs /etc/ssl/certs
27 | RUN true
28 | >>> COPY --from=0 /app/bin/gen-t-api /app/bin/gen-t-api
29 | CMD ["cargo run -r"]
30 |
-------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref moby::rgaiugj6nyskn2jsveh6l5b21: failed to walk /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: lstat /var/lib/docker/tmp/buildkit-mount4116245519/app/bin: no such file or directory

Error: Docker build failed
Solution:
it looks like you have modified the build and start commands? try removing the custom commands?
Jump to solution
13 Replies
Percy
Percy2y ago
Project ID: 977d5267-8c30-4ad4-b028-25ad1a926f41
romandev
romandev2y ago
977d5267-8c30-4ad4-b028-25ad1a926f41 i tried adding a env variable DOCKER_BUILDKIT = 0 but its the same error
Brody
Brody2y ago
are you building with your own dockerfile?
romandev
romandev2y ago
i dont have it
Brody
Brody2y ago
can you send the table at the top of the build logs
romandev
romandev2y ago
sure
==============
Using Nixpacks
==============

context: 10a19a9f185a256c99748fe03f2d82af

╔═══════════════════════════════ Nixpacks v1.5.1 ══════════════════════════════╗
║ build │ cargo build ║
║──────────────────────────────────────────────────────────────────────────────║
║ setup │ binutils, gcc, (rust-bin.stable.latest.default.override { ║
║ │ targets = ["x86_64-unknown-linux-musl"]; }), musl, musl.dev ║
║──────────────────────────────────────────────────────────────────────────────║
║ start │ cargo run -r ║
╚══════════════════════════════════════════════════════════════════════════════╝


#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.04kB done

#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
==============
Using Nixpacks
==============

context: 10a19a9f185a256c99748fe03f2d82af

╔═══════════════════════════════ Nixpacks v1.5.1 ══════════════════════════════╗
║ build │ cargo build ║
║──────────────────────────────────────────────────────────────────────────────║
║ setup │ binutils, gcc, (rust-bin.stable.latest.default.override { ║
║ │ targets = ["x86_64-unknown-linux-musl"]; }), musl, musl.dev ║
║──────────────────────────────────────────────────────────────────────────────║
║ start │ cargo run -r ║
╚══════════════════════════════════════════════════════════════════════════════╝


#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.04kB done

#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
Solution
Brody
Brody2y ago
it looks like you have modified the build and start commands? try removing the custom commands?
romandev
romandev2y ago
yeah should i remove the custom commands?
Brody
Brody2y ago
what was the purpose of changing them
romandev
romandev2y ago
idk, i think i suppose to do that i removed the custom commands and worked!
Brody
Brody2y ago
lol so all good?
romandev
romandev2y ago
yeah thanks
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server