containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.35k stars 776 forks source link

Error: checking if cached image exists from a previous build: getting top layer info: layer not known #5615

Open vrothberg opened 3 months ago

vrothberg commented 3 months ago

I have four parallel build jobs running. Each using the same base image. It pretty much builds down to podman build -t test-$iteration . followed by a podman rmi test-$iteration.

Sporadically, I get the error mentioned in the title. I did not check the code but it seems that buildah should consider an image to not exist when the top-layer has been removed.

Cc: @nalind @mheon

nburlett commented 2 months ago

I saw this as well, but I was not running parallel builds with the same base image. I was running two separate buildah unshare buildah bud ... commands, but with completely different dockerfiles that share no layers. This was with the podman 5.1.2 image from quay.io with buildah 1.35.1 installed. The job was running in jenkins on k8s and passed on a retry.

github-actions[bot] commented 1 month ago

A friendly reminder that this issue had no activity for 30 days.

edsantiago commented 1 month ago

oops, I only just noticed this. I'm 99% sure this is the same as #5674. You can work around it by adding --layers=false to all the builds commands.

nburlett commented 1 month ago

I've since switched to using --layers --cache-from $privaterepo --cache-to $privaterepo and I'm not seeing any failures.

In #5674 the reported issue is from building the same image twice. In my cases I was seeing an error building two unrelated images which I thought had no layers in common. I don't have the logs any more for the old builds so I can't double check.

rhatdan commented 1 month ago

Can we now close this issue?

github-actions[bot] commented 1 week ago

A friendly reminder that this issue had no activity for 30 days.