-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podman doesn't run image with invalid architecture #10682
Comments
Isn't it just |
I tried first without the docker.io part and it didn't work, so I thought that if I would add docker.io it would solve the issue. It doesn't. |
What does |
Ok, looks like it's not systemd fault. Try to run the following command (as root) twice. At first it will pull the image, and at the 2nd, it will give an error "Error: pihole: image not found"
journal doesn't show anything related. |
Works like a charm here:
|
I said twice. Don't clean the image, run it again. |
No problem here. Did you forget to stop the container or replace it? You can't run a daemon two times with the same name: podman run -d --name pi-hole ...
podman run -d --name pi-hole ...
. You have to remove that container to be able to reuse that name.: that name is already in use To replace it: podman run -d --name pi-hole --replace ... Or to stop it: podman stop pi-hole or podman stop --latest |
You're right, but the error that I get is something else (I think it's related to Fedora's Pi version). Take a look:
|
You need to login with the repository's credentials: root@debian:~# podman login
Authenticating with existing credentials...
Existing credentials are valid. Already logged in to docker.io
root@debian:~# podman run --rm -p 53:53/tcp -p 53:53/udp -p 67:67/udp -p 80:80/tcp -p 443:443/tcp -e DNS1=1.1.1.1 -e DNS2=8.8.8.8 -e TZ=America/New_York --name pi-hole -e WEBPASSWORD=blah pihole/pihole
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-resolver-resolv: applying...
[fix-attrs.d] 01-resolver-resolv: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 20-start.sh: executing...
::: Starting docker specific checks & setup for docker pihole/pihole |
This is from docker hub and I'm already logged in. In both cases it tries to pull from the same registry.
|
I think the pihole image is for amd64 only and not arm64. |
If it wasn't, it wouldn't be running on my Pi 4B |
Just to be sure, please try |
Same. It seems to be an aarch64 issue. |
@hetzbh Did this work prior v.3.2? |
Donno, I just installed Fedora 34 on Pi yesterday. |
@vrothberg PTAL, local image lookup is failing when the image is already downloaded. |
Interesting. I'm seeing something similar on my Gentoo laptop after upgrading this morning. Downgrading to 3.1.2 fixed it. |
@vrothberg PTAL |
Same issue here but on a Raspberry Pi 2 Model B Rev 1.1 (armv7l) running Fedora 34 IoT. |
The problem is with password-protected registries. I can reproduce this on my f34 laptop using master @ b3f61ec: $ ./bin/podman pull quay.io/edsantiago/acrosslite:0.1
....the usual logs...
$ ./bin/podman run !$ true
Error: quay.io/edsantiago/acrosslite:0.1: image not known |
Local image lookup is working as expected but the pihole image is wrong, see below: $ skopeo inspect --format "{{.Architecture}}" docker://docker.io/pihole/pihole@sha256:4e10b0a5cfa2f36ff29554599664b47e984986f48a713e1c0ad831b1cf88401a The arm64 image set its architecture to amd64. I think we need to loosen the platforms check in libimage as I prefer to keep using broken images over breaking workloads. |
Oh, blush, yeah, it's Arch, not password-protection. $ podman image inspect --format "{{.Architecture}}" quay.io/edsantiago/acrosslite:0.1
386
$ uname -m
x86_64 |
Note that a workaround is to use the image ID for It's tricky to have multi-arch support and be tolerant toward images with an incorrect arch. I am working on a fix for this specific case since the manifest list/image index is correct, just the image config is off. |
We must ignore the platform of a local image when doing lookups. Some images set an incorrect or even invalid platform (see containers/podman/issues/10682). Doing the lookup while ignoring the platform checks prevents redundantly downloading the same image. Note that this has the consequence that a `--pull-never --arch=hurz` may chose a local image of another architecture. However, I estimate the benefit of continuing to allow potentially invalid images higher than not running them (and breaking workloads). The changes required to touch the corrupted checks. I used the occasion to make the corrupted checks a bit cheaper. Signed-off-by: Valentin Rothberg <[email protected]>
Much to my regret, there is a number of images in the wild with invalid platforms breaking the platform checks in libimage that want to make sure that a local image is matching the expected platform. Imagine a `podman run --arch=arm64 fedora` with a local amd64 fedora image. We really shouldn't use the local one in this case and pull down the arm64 one. The strict platform checks in libimage in combination with invalid platforms in images surfaced in Podman being able to pull an image but failing to look it up in subsequent presence checks. A `podman run` would hence pull such an image but fail to create the container. Support images with invalid platforms by vendoring the latest HEAD from containers/common. Also remove the partially implemented pull-policy logic from Podman and let libimage handle that entirely. However, whenever --arch, --os or --platform are specified, the pull policy will be forced to "newer". This way, we pessimistically assume that the local image has an invalid platform and we reach out to the registry. If there's a newer image (i.e., one with a different digest), we'll pull it down. Please note that most of the logic has either already been implemented in libimage or been moved down which allows for removing some clutter from Podman. [NO TESTS NEEDED] since c/common has new tests. Podman can rely on the existing tests. Fixes: containers#10648 Fixes: containers#10682 Signed-off-by: Valentin Rothberg <[email protected]>
We must ignore the platform of a local image when doing lookups. Some images set an incorrect or even invalid platform (see containers/podman/issues/10682). Doing the lookup while ignoring the platform checks prevents redundantly downloading the same image. Note that this has the consequence that a `--pull-never --arch=hurz` may chose a local image of another architecture. However, I estimate the benefit of continuing to allow potentially invalid images higher than not running them (and breaking workloads). The changes required to touch the corrupted checks. I used the occasion to make the corrupted checks a bit cheaper. Signed-off-by: Valentin Rothberg <[email protected]>
Enforce the pull policy to always if a custom platform is requested by the user. Some images ship with invalid platforms which we must pessimistically assume, see containers/podman/issues/10682. Signed-off-by: Valentin Rothberg <[email protected]>
We must ignore the platform of a local image when doing lookups. Some images set an incorrect or even invalid platform (see containers/podman/issues/10682). Doing the lookup while ignoring the platform checks prevents redundantly downloading the same image. Note that this has the consequence that a `--pull-never --arch=hurz` may chose a local image of another architecture. However, I estimate the benefit of continuing to allow potentially invalid images higher than not running them (and breaking workloads). The changes required to touch the corrupted checks. I used the occasion to make the corrupted checks a bit cheaper. Signed-off-by: Valentin Rothberg <[email protected]>
Enforce the pull policy to always if a custom platform is requested by the user. Some images ship with invalid platforms which we must pessimistically assume, see containers/podman/issues/10682. Signed-off-by: Valentin Rothberg <[email protected]>
Much to my regret, there is a number of images in the wild with invalid platforms breaking the platform checks in libimage that want to make sure that a local image is matching the expected platform. Imagine a `podman run --arch=arm64 fedora` with a local amd64 fedora image. We really shouldn't use the local one in this case and pull down the arm64 one. The strict platform checks in libimage in combination with invalid platforms in images surfaced in Podman being able to pull an image but failing to look it up in subsequent presence checks. A `podman run` would hence pull such an image but fail to create the container. Support images with invalid platforms by vendoring the latest HEAD from containers/common. Also remove the partially implemented pull-policy logic from Podman and let libimage handle that entirely. However, whenever --arch, --os or --platform are specified, the pull policy will be forced to "newer". This way, we pessimistically assume that the local image has an invalid platform and we reach out to the registry. If there's a newer image (i.e., one with a different digest), we'll pull it down. Please note that most of the logic has either already been implemented in libimage or been moved down which allows for removing some clutter from Podman. [NO TESTS NEEDED] since c/common has new tests. Podman can rely on the existing tests. Fixes: containers#10648 Fixes: containers#10682 Signed-off-by: Valentin Rothberg <[email protected]>
Do not use the name of the locally resolved image when pulling an image with a custom platform. As we recently re-discovered [1], many multi-arch images in the wild do not adhere to the OCI image spec and either declare custom or simply wrong platforms (arch, os, variant). To address such wrong images, we enforce the pull-always policy whenever a custom arch, os or variant is specified. We have to do that since we cannot reliably perform platform matches to any image we would find in the local containers storage. To complete the fix, we need to ignore any local image and not use the locally resolved name which we usually have to do (see [2]). Let's assume we have a local image "localhost/foo" (arch=amd64). If we perform a `pull --arch=arm64`, we would not attempt to be pulling `localhost/foo` but use the ordinary short-name resolution and look for a matching alias or walk the unqualified-search registries. In other words: short-name resolution of multi-arch images is prone to errors but we should continue supporting images in the wild. [1] containers/podman/issues/10682 [2] containers/buildah/issues/2904 Signed-off-by: Valentin Rothberg <[email protected]>
Do not use the name of the locally resolved image when pulling an image with a custom platform. As we recently re-discovered [1], many multi-arch images in the wild do not adhere to the OCI image spec and either declare custom or simply wrong platforms (arch, os, variant). To address such wrong images, we enforce the pull-always policy whenever a custom arch, os or variant is specified. We have to do that since we cannot reliably perform platform matches to any image we would find in the local containers storage. To complete the fix, we need to ignore any local image and not use the locally resolved name which we usually have to do (see [2]). Let's assume we have a local image "localhost/foo" (arch=amd64). If we perform a `pull --arch=arm64`, we would not attempt to be pulling `localhost/foo` but use the ordinary short-name resolution and look for a matching alias or walk the unqualified-search registries. In other words: short-name resolution of multi-arch images is prone to errors but we should continue supporting images in the wild. [1] containers/podman/issues/10682 [2] containers/buildah/issues/2904 Signed-off-by: Valentin Rothberg <[email protected]>
When pulling down an image with a user-specified custom platform, we try to make sure that user gets what they are asking for. An inherent issue with multi-arch images is that there are many images in the wild which do not get the platform right (see containers/podman/issues/10682). That means we need to pessimistically assume that the local image is wrong and pull the "correct" one down from the registry; in the worst case that is redundant work but we have a guarantee of correctness. Motivated by containers/podman/issues/12707 I had another look at the code and found some space for optimizations. Previously, we enforced the pull policy to "always" but that may be too aggressive since we may be running in an airgapped environment and the local image is correct. With this change, we enforce the pull policy to "newer" which makes errors non-fatal in case a local image has been found; this seems like a good middleground between making sure we are serving the "correct" image and user friendliness. Signed-off-by: Valentin Rothberg <[email protected]>
When pulling down an image with a user-specified custom platform, we try to make sure that user gets what they are asking for. An inherent issue with multi-arch images is that there are many images in the wild which do not get the platform right (see containers/podman/issues/10682). That means we need to pessimistically assume that the local image is wrong and pull the "correct" one down from the registry; in the worst case that is redundant work but we have a guarantee of correctness. Motivated by containers/podman/issues/12707 I had another look at the code and found some space for optimizations. Previously, we enforced the pull policy to "always" but that may be too aggressive since we may be running in an airgapped environment and the local image is correct. With this change, we enforce the pull policy to "newer" which makes errors non-fatal in case a local image has been found; this seems like a good middleground between making sure we are serving the "correct" image and user friendliness. Signed-off-by: Valentin Rothberg <[email protected]>
When pulling down an image with a user-specified custom platform, we try to make sure that user gets what they are asking for. An inherent issue with multi-arch images is that there are many images in the wild which do not get the platform right (see containers/podman/issues/10682). That means we need to pessimistically assume that the local image is wrong and pull the "correct" one down from the registry; in the worst case that is redundant work but we have a guarantee of correctness. Motivated by containers/podman/issues/12707 I had another look at the code and found some space for optimizations. Previously, we enforced the pull policy to "always" but that may be too aggressive since we may be running in an airgapped environment and the local image is correct. With this change, we enforce the pull policy to "newer" which makes errors non-fatal in case a local image has been found; this seems like a good middleground between making sure we are serving the "correct" image and user friendliness. Signed-off-by: Valentin Rothberg <[email protected]>
After containers/podman/issues/10682, we decided to always re-pull images of non-local platforms and match *any* local image. Over time, we refined this logic to not *always* pull the image but only if there is a *newer* one. This has slightly changed the semantics and requires to perform platform checks when looking up a local image. Otherwise, bogus values would match a local image and mistakenly return it. Signed-off-by: Valentin Rothberg <[email protected]>
After containers/podman/issues/10682, we decided to always re-pull images of non-local platforms and match *any* local image. Over time, we refined this logic to not *always* pull the image but only if there is a *newer* one. This has slightly changed the semantics and requires to perform platform checks when looking up a local image. Otherwise, bogus values would match a local image and mistakenly return it. Signed-off-by: Valentin Rothberg <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When I start a simple systemd service that I created and it needs to pull an image, if an image is already in the local cache, it fails with this message on the journal:
However, if I clean the cache (podman rmi pihole) prior to running the systemd service, it starts without an issue.
Here is my systemd service script (it runs as root, I know about security issues about the ports, it's just temporary):
Steps to reproduce the issue:
podman pull pihole/pihole
(as root)podman images
)systemd start pihole
)podman rmi pihole
)Describe the results you received:
When the image is in the cache, it fails to start the service. When it's not, it pulls the image and then it works.
Describe the results you expected:
It should work and skip pulling if it's already in the cache without failing.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Raspberry Pi 4B, 4GB version, Fedora 34 (Server)
The text was updated successfully, but these errors were encountered: