podman: "Podman image pull" API returns wrong response type and content

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

/kind bug

Description

“Podman image pull” API doesn’t return JSON valid response as it should according to documentation.

Steps to reproduce the issue:

  1. curl -XPOST --unix-socket /tmp/podman.sock -v 'http://d/v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2Fpodman'

*   Trying /tmp/podman.sock:0...
* Connected to d (///tmp/podman.sock) port 80 (#0)
> POST /v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2Fpodman HTTP/1.1
> Host: d
> User-Agent: curl/7.71.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.1.2
< Server: Libpod/3.1.2 (linux)
< Date: Wed, 09 Jun 2021 13:22:46 GMT
< Transfer-Encoding: chunked
< 
{"stream":"Trying to pull quay.io/containers/podman:latest...\n"}
{"stream":"Getting image source signatures\n"}
{"stream":"Copying blob sha256:4a2de6335f1a7be095e492298f1377cddf3dac1d439ce80c3a0f17cbc5db0300\n"}
{"stream":"Copying blob sha256:09314a9d4cc08a83838f17512117bb06179947b1731a685fe8f94c937f7e98c0\n"}
{"stream":"Copying blob sha256:7679c09af3851a1622782c74864351c296a0d1886813862fd7116383aeba9f07\n"}
{"stream":"Copying blob sha256:60d08034c11c826d1f5896c72f81c681259648921e692bc5b04301bb052c8606\n"}
{"stream":"Copying blob sha256:8f77c940d9cb04a54631f5fa3265c5dcf5165522c0657b632b6e9b410ce8e0a9\n"}
{"stream":"Copying blob sha256:1895eb770ea58b18a42e358ebd859249a2f6aed28cef76771033784966d075c9\n"}
{"stream":"Copying blob sha256:5fb7d3d587867567ac6a9d8614357c0d9b9aeae83746bac43204c8c0f2f3a3b5\n"}
{"stream":"Copying blob sha256:82ec0bb7a7e034ce15c72705efc2009b63a11a65dbf0b4efd79c48e109b9aa32\n"}
{"stream":"Copying config sha256:a82c6f1ecc97c392642ebab5bdbcc871d58fd9dc039ab3283d56a37017d4bec4\n"}
{"stream":"Writing manifest to image destination\n"}
{"stream":"Storing signatures\n"}
{"images":["a82c6f1ecc97c392642ebab5bdbcc871d58fd9dc039ab3283d56a37017d4bec4"]}
{"id":"a82c6f1ecc97c392642ebab5bdbcc871d58fd9dc039ab3283d56a37017d4bec4"}
* Connection #0 to host d left intact

Describe the results you received:

text instead of JSON response, and even text is not as expected

Describe the results you expected:

According to: https://docs.podman.io/en/latest/_static/api.html#operation/ImagePullLibpod it should be:

{
    "error": "string",
    "id": "string",
    "images": 
    [
        "string"
    ],
    "stream": "string"
}

So in our case I’d expect for:

{
    "error": "",
    "id": "a82c6f1ecc97c392642ebab5bdbcc871d58fd9dc039ab3283d56a37017d4bec4",
    "images": 
    [
        "a82c6f1ecc97c392642ebab5bdbcc871d58fd9dc039ab3283d56a37017d4bec4"
    ],
    "stream": "Trying to pull quay.io/containers/podman:latest...\nGetting image source signatures\nCopying blob sha256:4a2de6335f1a7be095e492298f1377cddf3dac1d439ce80c3a0f17cbc5db0300\n...Storing signatures\n"
}

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:      3.1.2
API Version:  3.1.2
Go Version:   go1.15.11
Built:        Tue May 11 16:53:47 2021
OS/Arch:      linux/amd64

Output of podman info --debug:


host:
  arch: amd64
  buildahVersion: 1.20.1
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.27-2.fc33.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 12
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: journald
  hostname: sshnaidm.remote
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.12.7-200.fc33.x86_64
  linkmode: dynamic
  memFree: 275320832
  memTotal: 33388392448
  ociRuntime:
    name: crun
    package: crun-0.19.1-3.fc33.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.19.1
      commit: 1535fedf0b83fb898d449f9680000f729ba719f5
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.9-1.fc33.x86_64
    version: |-
      slirp4netns version 1.1.9
      commit: 4e37ea557562e0d7a64dc636eff156f64927335e
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 0
  swapTotal: 4294963200
  uptime: 193h 37m 17.43s (Approximately 8.04 days)
registries:
  192.168.2.52:5000:
    Blocked: false
    Insecure: true
    Location: 192.168.2.52:5000
    MirrorByDigestOnly: false
    Mirrors: null
    Prefix: 192.168.2.52:5000
  search:
  - docker.io
  - quay.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
store:
  configFile: /home/sshnaidm/.config/containers/storage.conf
  containerStore:
    number: 18
    paused: 0
    running: 0
    stopped: 18
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.5.0-1.fc33.x86_64
      Version: |-
        fusermount3 version: 3.9.3
        fuse-overlayfs: version 1.5
        FUSE library version 3.9.3
        using FUSE kernel interface version 7.31
  graphRoot: /home/sshnaidm/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 182
  runRoot: /run/user/1000/containers
  volumePath: /home/sshnaidm/.local/share/containers/storage/volumes
version:
  APIVersion: 3.1.2
  Built: 1620741227
  BuiltTime: Tue May 11 16:53:47 2021
  GitCommit: ""
  GoVersion: go1.15.11
  OsArch: linux/amd64
  Version: 3.1.2

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

podman-3.1.2-2.fc33.x86_64

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)

No

Additional environment details (AWS, VirtualBox, physical, etc.):

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Does this mean we have to wait for podman 4 for this fix to go in?