buildah icon indicating copy to clipboard operation
buildah copied to clipboard

buildah manifest push fails with "manifest blob unknown: blob unknown to registry" when not add --all

Open Vanient opened this issue 6 years ago • 5 comments

Description I create a new manifest and wanna push it to registry first time, push fails if I haven't added --all. I'm not sure whether the way I use buildah manifest is correct, why --all is necessary?

Steps to reproduce the issue: 1.buildah manifest create newone 2.buildah manifest add --tls-verify=false newone docker://localhost:5000/busybox_x86 3.buildah manifest push --tls-verify=false -f v2s2 newone docker://localhost:5000/newone

Describe the results you received: Error messages: Uploading manifest list failed, attempted the following formats: application/vnd.docker.distribution.manifest.list.v2+json(Error uploading manifest latest to localhost:5000/newone: manifest blob unknown: blob unknown to registry)

Version ➜ buildah git:(master) buildah version
Version: 1.18.0-dev Go Version: go1.13.3 Image Spec: 1.0.1-dev Runtime Spec: 1.0.2-dev CNI Spec: 0.4.0 libcni Version: v0.7.2-0.20190904153231-83439463f784 image Version: 5.7.0 Git Commit: 5c27e00 Built: Wed Nov 4 14:58:05 2020 OS/Arch: linux/amd64

Vanient avatar Nov 04 '20 09:11 Vanient

@QiWang19 PTAL

rhatdan avatar Nov 04 '20 13:11 rhatdan

@Vanient the --all is required in the manifest push here, without --all it just pushes the manifest itself without the images in it. The registry can reject the manifest list because the registry doesn't have it for that repository. Use --all will go through each item from the manifest list and check if the registry already has it, and try to only upload it if the registry doesn't already have it.

QiWang19 avatar Nov 16 '20 20:11 QiWang19

@Vanient the --all is required in the manifest push here, without --all it just pushes the manifest itself without the images in it. The registry can reject the manifest list because the registry doesn't have it for that repository. Use --all will go through each item from the manifest list and check if the registry already has it, and try to only upload it if the registry doesn't already have it.

Thanks for reply, but still have question for that. What the "The registry can reject the manifest list because the registry doesn't have it for that repository" means? Images in the list already exists at the registry, why should I push them again not just push the list? Or Maybe you could give me an example, in what kind of case I could not add --all to push.

Vanient avatar Nov 18 '20 01:11 Vanient

@Vanient From my understanding, the -all will try to push the images in the manifest list fist(check if the image is already there and attempt to upload it), and then the list itself. WIthout the --all, only the manifest list will be pushed, the registry may reject the list since it references a manifest that the registry doesn't have. There is some explanation also.

QiWang19 avatar Nov 18 '20 03:11 QiWang19

While working on a manifest list feature , I stumbled upon this issue and I found it difficult to find what is happening at first, I think by default we should allow pushing all images in manifest list and allow pushing manifest without images if there is any special need i.e --omit-images or something similar.

Reason is that I don't think by default any body would like to push flat manifest list without images, cause I don't see lot of use-cases there. So I think we should flip this logic ( but this is just my opinion :) and not a strong one )

@containers/buildah-maintainers @containers/podman-maintainers WDYT ?

flouthoc avatar Jan 11 '23 10:01 flouthoc