containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.67k stars 2.41k forks source link

[Query] Unable to build/run images #13138

Closed vipinvkmenon closed 2 years ago

vipinvkmenon commented 2 years ago

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I'm assuming this is more of a troubleshooting/configuration issue. However, I could not find a similar issue in the troubleshooting guide.

Steps to reproduce the issue:

  1. Installed podman in mac using brew

  2. Initialised machine podman machine init and started them podman machine start

  3. Verify working status:

    
    podman machine list
    NAME                     VM TYPE     CREATED      LAST UP            CPUS        MEMORY      DISK SIZE
    podman-machine-default*  qemu        2 hours ago  Currently running  1           2.147GB     10.74GB

podman system connection list Name Identity URI podman-machine-default* /Users/k/.ssh/podman-machine-default ssh://core@localhost:65137/run/user/1000/podman/podman.sock podman-machine-default-root /Users/k/.ssh/podman-machine-default ssh://root@localhost:65137/run/podman/podman.sock

podman version:

podman --version podman version 3.4.4


podman version Client: Version: 3.4.4 API Version: 3.4.4 Go Version: go1.17.3 Built: Thu Dec 9 00:11:11 2021 OS/Arch: darwin/amd64

Server: Version: 3.4.4 API Version: 3.4.4 Go Version: go1.16.8 Built: Thu Dec 9 03:15:07 2021 OS/Arch: linux/amd64

My Machine details: MacOS Monterey 12.1 (Intel )

uname -a Darwin C02XC0ZPJGH5 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 x86_64


4. Run nginx

podman run -dt -p 8080:80 nginx


**Result received:**

podman --log-level=debug run -dt -p 8080:80 nginx INFO[0000] podman filtering at log level debug DEBU[0000] Called run.PersistentPreRunE(podman --log-level=debug run -dt -p 8080:80 nginx) DEBU[0000] SSH Ident Key "/Users/k/.ssh/podman-machine-default" SHA256: ssh-ed25519 DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ESzXNsREXi/Listeners", ssh-agent signer(s) enabled DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.4/libpod/_ping DEBU[0000] Adding port mapping from 8080 to 80 length 1 protocol "" DEBU[0000] Loading registries configuration "/etc/containers/registries.conf" DEBU[0000] No credentials for https://index.docker.io/v1/ found DEBU[0000] Found credentials for docker.io in credential helper containers-auth.json in file /Users/k/.config/containers/auth.json Traceback (most recent call last): File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in main() File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main from googlecloudsdk.core.util import encoding File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/init.py", line 23, in from googlecloudsdk.core.util import importing File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in import imp File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in from importlib import util File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in from . import abc File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in from typing import Protocol, runtime_checkable File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in import re as stdlib_re # Avoid confusion with the re we export. File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in import enum File "/Users/k/Downloads/google-cloud-sdk/lib/third_party/enum/init.py", line 26, in spec = importlib.util.find_spec('enum') AttributeError: module 'importlib' has no attribute 'util' DEBU[0000] Error looking up credentials for staging-k8s.gcr.io in credential helper containers-auth.json: error getting credentials - err: exit status 1, out: `` Error: 1 error occurred:

**Expected result:**
Running container for nginx.

**Additional information :**

I don't think I have registered on GCR in podman....
Additionally, I logged into docker.io with podman (successful)
Additionally, I have renamed `/Users/k/.config/gcloud` 

checking `/Users/k/.config/containers/auth.json` has an entry for docker.io only
checking `/Users/k/.config/containers/`

[containers]

[engine] active_service = "podman-machine-default" [engine.service_destinations] [engine.service_destinations.podman-machine-default] uri = "ssh://core@localhost:65137/run/user/1000/podman/podman.sock" identity = "/Users/k/.ssh/podman-machine-default" [engine.service_destinations.podman-machine-default-root] uri = "ssh://root@localhost:65137/run/podman/podman.sock" identity = "/Users/k/.ssh/podman-machine-default"

[machine]

[network]

[secrets]


**Output of `podman version`:**

podman version Client: Version: 3.4.4 API Version: 3.4.4 Go Version: go1.17.3 Built: Thu Dec 9 00:11:11 2021 OS/Arch: darwin/amd64

Server: Version: 3.4.4 API Version: 3.4.4 Go Version: go1.16.8 Built: Thu Dec 9 03:15:07 2021 OS/Arch: linux/amd64


**Output of `podman info --debug`:**

podman info --debug host: arch: amd64 buildahVersion: 1.23.1 cgroupControllers:

Package info (e.g. output of rpm -q podman or apt list podman):

brew info podman
podman: stable 3.4.4 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/usr/local/Cellar/podman/3.4.4 (170 files, 40MB) *
  Poured from bottle on 2022-01-24 at 16:01:04
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go ✘, go-md2man ✘
Required: qemu ✔
==> Options
--HEAD
    Install HEAD version
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Analytics
install: 16,257 (30 days), 39,222 (90 days), 93,574 (365 days)
install-on-request: 16,252 (30 days), 39,226 (90 days), 93,564 (365 days)
build-error: 1 (30 days)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? Currently on 3.4.4

Podman Troubleshooting Guide: Yes

Additional environment details:

MacOS Monterey 12.1 (Intel )

uname -a
Darwin x02Xt0ZPaGH1 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 x86_64
TomSweeneyRedHat commented 2 years ago

@ashley-cui or @jwhonce any thoughts?

@vipinvkmenon this smells like something is going south with the credentials. Which I wouldn't suspect would be necessary for running nginx. Are you able to pull the nginx image or do you get similar complaints?

vipinvkmenon commented 2 years ago

tried pulling nginx

podman pull nginx --log-level=debug
INFO[0000] podman filtering at log level debug
DEBU[0000] Called pull.PersistentPreRunE(podman pull nginx --log-level=debug)
DEBU[0000] SSH Ident Key "/Users/k/.ssh/podman-machine-default" SHA256:<redact> ssh-ed25519
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ESzXNsREXi/Listeners", ssh-agent signer(s) enabled
DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.4/libpod/_ping
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] Found credentials for docker.io in credential helper containers-auth.json in file /Users/k/.config/containers/auth.json
Traceback (most recent call last):
  File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
    main()
  File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main
    from googlecloudsdk.core.util import encoding
  File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
    from googlecloudsdk.core.util import importing
  File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
    import imp
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
    from importlib import util
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
    from . import abc
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
    from typing import Protocol, runtime_checkable
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
    import re as stdlib_re  # Avoid confusion with the re we export.
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
    import enum
  File "/Users/k/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
    spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
DEBU[0000] Error looking up credentials for gcr.io in credential helper containers-auth.json: error getting credentials - err: exit status 1, out: ``
Error: 1 error occurred:
    * error getting credentials - err: exit status 1, out: ``

Results in the same error. Same if I tried podman run --name docker-nginx -p 8080:80 docker.io/nginx

Tried building the following Dockerfile

FROM docker.io/docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay

podman build -t whalesay . --log-level=debug
INFO[0000] podman filtering at log level debug
DEBU[0000] Called build.PersistentPreRunE(podman build -t whalesay . --log-level=debug)
DEBU[0000] SSH Ident Key "/Users/k/.ssh/podman-machine-default" SHA256:<redact> ssh-ed25519
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ESzXNsREXi/Listeners", ssh-agent signer(s) enabled
DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.4/libpod/_ping
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
Traceback (most recent call last):
  File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
    main()
  File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main
    from googlecloudsdk.core.util import encoding
  File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
    from googlecloudsdk.core.util import importing
  File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
    import imp
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
    from importlib import util
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
    from . import abc
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
    from typing import Protocol, runtime_checkable
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
    import re as stdlib_re  # Avoid confusion with the re we export.
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
    import enum
  File "/Users/k/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
    spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
DEBU[0000] Error looking up credentials for us.gcr.io in credential helper containers-auth.json: error getting credentials - err: exit status 1, out: ``
Error: 1 error occurred:
    * error getting credentials - err: exit status 1, out: 

What is the relation to the gclud-sdk in my downloads to this is a bit mystery 🧐

vipinvkmenon commented 2 years ago

I tried moving the gcloud-sdk from the folder and $PATH:

podman pull nginx
Error: 1 error occurred:
    * error getting credentials - err: exec: "docker-credential-gcloud": executable file not found in $PATH, out: ``
vipinvkmenon commented 2 years ago

Ah interesting...... Renamed .docker folder and it started working just fine. So podman looks for Docker installation/ configurations on the system.... Failed to read that part of the Documentation I guess :)

vipinvkmenon commented 2 years ago

Ok....I guess, I'll close this ticket. Finally, read the part where podman login where it tries to read $HOME/.docker/config.json. Thanks Guys