Closed spkane closed 2 years ago
A friendly reminder that this issue had no activity for 30 days.
@ashley-cui PTAL
@mtrmac may be able to help track the bug down on Mac OS.
~/.docker/config.json
or ~/.config/containers/auth.json
? In registries.conf
?podman --log-level=debug login
and podman --log-level=debug pull
could help reveal what is being read/written.Thank you for that feedback @mtrmac. It helped me narrow down the issue.
~/.docker/config.json
:...
"credHelpers" : {
"000000000000.dkr.ecr.us-west-2.amazonaws.com" : "ecr-login"
},
...
Removing it works around the reported problem, but is obviously not the desired solution.
After looking at the debugging below, I saw this:
DEBU[0000] Error looking up credentials for 000000000000.dkr.ecr.us-west-2.amazonaws.com in credential helper containers-auth.json: credentials not found in native keychain
So, it appears to be trying to lookup the credentials for that registry even though I am not trying to pull from registry. And to be fair, that is an old AWS ECR registry so I can pull it out, but it feels like there might still be a bug here, since it is looking for credentials for a registry that I am not trying to interact with.
$ podman login --log-level=debug docker.io
INFO[0000] podman filtering at log level debug
DEBU[0000] Called login.PersistentPreRunE(podman login --log-level=debug docker.io)
DEBU[0000] SSH Ident Key "/Users/spkane/.ssh/podman-machine-default" SHA256:... ssh-ed25519
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ru7ZJV89WE/Listeners", ssh-agent signer(s) enabled
DEBU[0000] SSH Agent Key SHA256:... ssh-ed25519
DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.1/libpod/_ping
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] Found credentials for docker.io in credential helper containers-auth.json
Authenticating with existing credentials for docker.io
DEBU[0000] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
DEBU[0000] GET https://registry-1.docker.io/v2/
DEBU[0000] Ping https://registry-1.docker.io/v2/ status 401
DEBU[0000] GET https://auth.docker.io/token?account=spkane&service=registry.docker.io
DEBU[0001] GET https://registry-1.docker.io/v2/
Existing credentials are valid. Already logged in to docker.io
DEBU[0001] Called login.PersistentPostRunE(podman login --log-level=debug docker.io)
$ podman --log-level=debug pull docker.io/spkane/outyet:latest
INFO[0000] podman filtering at log level debug
DEBU[0000] Called pull.PersistentPreRunE(podman --log-level=debug pull docker.io/spkane/outyet:latest)
DEBU[0000] SSH Ident Key "/Users/spkane/.ssh/podman-machine-default" SHA256:... ssh-ed25519
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ru7ZJV89WE/Listeners", ssh-agent signer(s) enabled
DEBU[0000] SSH Agent Key SHA256:... ssh-ed25519
DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.1/libpod/_ping
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] Found credentials for docker.io in credential helper containers-auth.json
DEBU[0000] Error looking up credentials for 000000000000.dkr.ecr.us-west-2.amazonaws.com in credential helper containers-auth.json: credentials not found in native keychain
Error: 1 error occurred:
* credentials not found in native keychain
Is this a “remote” Podman connecting to a remote server?
serviceIsRemote: true
In that case, IIRC podman pull
on the client collects all credentials and sends them to the server, even for registries not specifically named on the command line (@vrothberg please confirm or correct me); that’s necessary to support mirrors (… without excessive implementation complexity, at least).
I am running podman machine start
on my Mac. I suppose that could be considered remote, since it is a VM by necessity.
If what you suspect is true, maybe simply printing a warning would suffice if it can't find credentials for one of the registries, and leave it up to the remote system to throw an error if it actually fails to auth against the registry...
I have filed https://github.com/containers/image/issues/1406 to add more context to the reported error.
As for whether failures to get credentials should be non-fatal, I’ll let Podman maintainers decide.
It should not be fatal, all we care about is pulling the image, This should be a warning.
@vrothberg PTAL, this seems to be more podman-remote then podman machine.
Thank you for that feedback @mtrmac. It helped me narrow down the issue.
- Something very close to this was in my
~/.docker/config.json
:... "credHelpers" : { "000000000000.dkr.ecr.us-west-2.amazonaws.com" : "ecr-login" }, ...
I ran into this issue today. To work around it I ended up removing the Docker-style configuration from ~/.docker/config.json
and instead adding the equivalent podman
configuration to ~/.config/containers/registries.conf
:
credential-helpers = [ "ecr-login" ]
Now I can pull both images that do not require auth as well as ECR images.
There's actually a bug in c/image. It's totally 0K when a credential helper doesn't have credentials but the error should be checked for and we do, but just not in this specific code path.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
On macOS, registry credentials do not appear to work properly.
Steps to reproduce the issue:
podman
to login to docker.iopodman
docker
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
podman pull
to work if I pass the credentials in on the command line.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.):