Skip to content
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 image pull" API returns wrong response type and content #10612

Closed
sshnaidm opened this issue Jun 9, 2021 · 27 comments · Fixed by #11154
Closed

"Podman image pull" API returns wrong response type and content #10612

sshnaidm opened this issue Jun 9, 2021 · 27 comments · Fixed by #11154
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@sshnaidm
Copy link
Member

sshnaidm commented Jun 9, 2021

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.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 9, 2021
@mheon
Copy link
Member

mheon commented Jun 9, 2021

@jwhonce PTAL. This looks like a case where we forgot to update documentation after we added progress reporting?

@sshnaidm
Copy link
Member Author

sshnaidm commented Jun 9, 2021

The another problem is that API returns 200 HTTP code when failed to find and pull the image.
I think it should be 404:

$ curl -XPOST --unix-socket /tmp/newpodman.sock -v 'http://d/v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2F1podman'
*   Trying /tmp/newpodman.sock...
* Connected to d (///tmp/newpodman.sock) port 80 (#0)
> POST /v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2F1podman HTTP/1.1
> Host: d
> User-Agent: curl/7.61.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.1.0-dev
< Server: Libpod/3.1.0-dev (linux)
< Date: Wed, 09 Jun 2021 17:44:04 GMT
< Transfer-Encoding: chunked
< 
{"stream":"Trying to pull quay.io/containers/1podman:latest...\n"}
{"stream":"  unauthorized: access to the requested resource is not authorized\n"}
{"error":"Error initializing source docker://quay.io/containers/1podman:latest: Error reading manifest latest in quay.io/containers/1podman: unauthorized: access to the requested resource is not authorized\n"}
* Connection #0 to host d left intact

@rhatdan
Copy link
Member

rhatdan commented Jun 11, 2021

@cdoern PTAL

@rhatdan
Copy link
Member

rhatdan commented Jun 11, 2021

@sshnaidm Interested in opening a PR to fix?

@cdoern
Copy link
Contributor

cdoern commented Jun 11, 2021

The another problem is that API returns 200 HTTP code when failed to find and pull the image.
I think it should be 404:

$ curl -XPOST --unix-socket /tmp/newpodman.sock -v 'http://d/v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2F1podman'
*   Trying /tmp/newpodman.sock...
* Connected to d (///tmp/newpodman.sock) port 80 (#0)
> POST /v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2F1podman HTTP/1.1
> Host: d
> User-Agent: curl/7.61.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.1.0-dev
< Server: Libpod/3.1.0-dev (linux)
< Date: Wed, 09 Jun 2021 17:44:04 GMT
< Transfer-Encoding: chunked
< 
{"stream":"Trying to pull quay.io/containers/1podman:latest...\n"}
{"stream":"  unauthorized: access to the requested resource is not authorized\n"}
{"error":"Error initializing source docker://quay.io/containers/1podman:latest: Error reading manifest latest in quay.io/containers/1podman: unauthorized: access to the requested resource is not authorized\n"}
* Connection #0 to host d left intact

Podman returns a 200 even when the image is not found as long as the request itself is valid. 400 is reserved for a bad parameter. I am looking into now why the json is not as it should be

@cdoern
Copy link
Contributor

cdoern commented Jun 11, 2021

@sshnaidm I was able to alter the JSON encoding to read as follows:

[charliedoern@charliesthinkpad podman]$ curl -XPOST --unix-socket /run/user/1000/podman/podman.sock -v 'http://d/v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2Fpodman'
*   Trying /run/user/1000/podman/podman.sock:0...
* Connected to d (/run/user/1000/podman/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.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.3.0-dev
< Server: Libpod/3.3.0-dev (linux)
< Date: Fri, 11 Jun 2021 15:50:36 GMT
< Transfer-Encoding: chunked
< 
{"stream":"Trying to pull quay.io/containers/podman:latest...\nGetting image source signatures\nCopying blob sha256:dbfdc88672b7900f151eac3951c1b4a3824118e123d1caa5e0cbf9c2e3631452\nCopying blob sha256:ef14cb6670acaea6f2129ab854a5074c07445cf109dcf5d7d3aff6ee88387c98\nCopying blob sha256:6507c6319c7214ff62fce6992997a2328153d201abcf22fff1fd293154a5668f\nCopying blob sha256:a7c5dbee8afd212fc7f1b5b0634a7da82107442823195156ff4ffb8ae7440bef\nCopying blob sha256:811fa2fea152d9f15282392de468efd9c59f973916a57069c14f2c5145bd83b6\nCopying blob sha256:0aa6a876cfe9802249831655b28dcf7c35da8b54ff8eeb5c8951c162939de925\nCopying blob sha256:7679c09af3851a1622782c74864351c296a0d1886813862fd7116383aeba9f07\nCopying blob sha256:2c62e1b053968f9af83a41136fa921a619732aad12edf176593a8d7fc696738f\nCopying config sha256:132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0\nWriting manifest to image destination\nStoring signatures\n","images":["132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"],"id":"132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"}

Before I submit a PR to fix, does this look right to you or is there something more specific you expect to be output here? Also comment above explains 200 vs. 404 response.

@sshnaidm
Copy link
Member Author

The another problem is that API returns 200 HTTP code when failed to find and pull the image.
I think it should be 404:

Podman returns a 200 even when the image is not found as long as the request itself is valid. 400 is reserved for a bad parameter. I am looking into now why the json is not as it should be

Thanks, I see 400 is reserved, but I'm talking about 404 response. It's logical to have it if no image present, for example like it's done for inspect: https://docs.podman.io/en/latest/_static/api.html#operation/ImageInspectLibpod
Code 200 should be returned only in case image exists and pulled successfully.

@sshnaidm
Copy link
Member Author

@sshnaidm I was able to alter the JSON encoding to read as follows:

Before I submit a PR to fix, does this look right to you or is there something more specific you expect to be output here? Also comment above explains 200 vs. 404 response.

Thanks! That's exactly what I'd expect.

@mheon
Copy link
Member

mheon commented Jun 11, 2021

I'm a little concerned by that change, @cdoern - is it still streaming as the messages occur? It's crucial that the messages be printed as they happen on the server, to provide real-time progress reports to user-facing podman-remote pull calls.

@cdoern
Copy link
Contributor

cdoern commented Jun 11, 2021

@mheon no what I did was just concatenated all of the stream messages into a string and put the json together when the run context was closed. Should I keep it like this (for final output purposes) and also stream it to the user? I was also able to format it like this using enc.setIndent():

* Connected to d (/run/user/1000/podman/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.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.3.0-dev
< Server: Libpod/3.3.0-dev (linux)
< Date: Fri, 11 Jun 2021 17:13:50 GMT
< Transfer-Encoding: chunked
< 
{
	"stream": "Trying to pull quay.io/containers/podman:latest...\nGetting image source signatures\nCopying blob sha256:ef14cb6670acaea6f2129ab854a5074c07445cf109dcf5d7d3aff6ee88387c98\nCopying blob sha256:dbfdc88672b7900f151eac3951c1b4a3824118e123d1caa5e0cbf9c2e3631452\nCopying blob sha256:7679c09af3851a1622782c74864351c296a0d1886813862fd7116383aeba9f07\nCopying blob sha256:6507c6319c7214ff62fce6992997a2328153d201abcf22fff1fd293154a5668f\nCopying blob sha256:2c62e1b053968f9af83a41136fa921a619732aad12edf176593a8d7fc696738f\nCopying blob sha256:a7c5dbee8afd212fc7f1b5b0634a7da82107442823195156ff4ffb8ae7440bef\nCopying blob sha256:0aa6a876cfe9802249831655b28dcf7c35da8b54ff8eeb5c8951c162939de925\nCopying blob sha256:811fa2fea152d9f15282392de468efd9c59f973916a57069c14f2c5145bd83b6\nCopying config sha256:132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0\nWriting manifest to image destination\nStoring signatures\n",
	"images": [
		"132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"
	],
	"id": "132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"
}

@mheon
Copy link
Member

mheon commented Jun 11, 2021

It doesn' sound like that does what we need - sending the JSON only at the end is going to break user interactive use cases.

For reference, the current implementation exactly matches Docker, which means we probably did this deliberately. I don't think we should be changing anything here, just documenting how things work.

@sshnaidm
Copy link
Member Author

@mheon what is the user interactive use case in API?

@mheon
Copy link
Member

mheon commented Jun 11, 2021

@sshnaidm The API also has to support the podman-remote commands, which need to be able to report the current status of the pull back to the user. Other tools can consume this as well - we're basically streaming the current progress bar so it can be displayed.

@sshnaidm
Copy link
Member Author

@mheon well... I don't know, having one call without valid JSON in API seems weird to me, even just for progress bar. Maybe adding an option no-progress-bar? I think other tools would be more expecting a standard response, then making workaround about it like it's done in podman-py: https://github.com/containers/podman-py/blob/850f97cef0867e3ba1a383d7c2a4068b95849de9/podman/domain/images_manager.py#L306-L315

@mheon
Copy link
Member

mheon commented Jun 11, 2021

If we don't already have a quiet parameter to suppress the extra status info, adding one sounds like a good idea

@cdoern
Copy link
Contributor

cdoern commented Jun 11, 2021

ok sounds good @mheon i'll revert to how it was, edit docs and add a quiet param if there isn't one.

@cdoern
Copy link
Contributor

cdoern commented Jun 11, 2021

@mheon would something like this for a quiet response:

[charliedoern@charliesthinkpad podman]$ curl -XPOST --unix-socket /run/user/1000/podman/podman.sock -v 'http://d/v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2Fpodman&quiet=true'
*   Trying /run/user/1000/podman/podman.sock:0...
* Connected to d (/run/user/1000/podman/podman.sock) port 80 (#0)
> POST /v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2Fpodman&quiet=true HTTP/1.1
> Host: d
> User-Agent: curl/7.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.3.0-dev
< Server: Libpod/3.3.0-dev (linux)
< Date: Fri, 11 Jun 2021 19:05:29 GMT
< Transfer-Encoding: chunked
< 
{
	"stream": "Trying to pull quay.io/containers/podman:latest...\nGetting image source signatures\nCopying blob sha256:dbfdc88672b7900f151eac3951c1b4a3824118e123d1caa5e0cbf9c2e3631452\nCopying blob sha256:ef14cb6670acaea6f2129ab854a5074c07445cf109dcf5d7d3aff6ee88387c98\nCopying blob sha256:6507c6319c7214ff62fce6992997a2328153d201abcf22fff1fd293154a5668f\nCopying blob sha256:2c62e1b053968f9af83a41136fa921a619732aad12edf176593a8d7fc696738f\nCopying blob sha256:0aa6a876cfe9802249831655b28dcf7c35da8b54ff8eeb5c8951c162939de925\nCopying blob sha256:7679c09af3851a1622782c74864351c296a0d1886813862fd7116383aeba9f07\nCopying blob sha256:811fa2fea152d9f15282392de468efd9c59f973916a57069c14f2c5145bd83b6\nCopying blob sha256:a7c5dbee8afd212fc7f1b5b0634a7da82107442823195156ff4ffb8ae7440bef\nCopying config sha256:132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0\nWriting manifest to image destination\nStoring signatures\n",
	"images": [
		"132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"
	],
	"id": "132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"
}

and then this for a regular response:

[charliedoern@charliesthinkpad podman]$ curl -XPOST --unix-socket /run/user/1000/podman/podman.sock -v 'http://d/v2.0.0/libpod/images/pull?reference=quay.io%2Fcontainers%2Fpodman'
*   Trying /run/user/1000/podman/podman.sock:0...
* Connected to d (/run/user/1000/podman/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.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Libpod-Api-Version: 3.3.0-dev
< Server: Libpod/3.3.0-dev (linux)
< Date: Fri, 11 Jun 2021 19:05:17 GMT
< Transfer-Encoding: chunked
< 
{
	"stream": "Trying to pull quay.io/containers/podman:latest...\n"
}
{
	"stream": "Getting image source signatures\n"
}
{
	"stream": "Copying blob sha256:ef14cb6670acaea6f2129ab854a5074c07445cf109dcf5d7d3aff6ee88387c98\n"
}
{
	"stream": "Copying blob sha256:dbfdc88672b7900f151eac3951c1b4a3824118e123d1caa5e0cbf9c2e3631452\n"
}
{
	"stream": "Copying blob sha256:811fa2fea152d9f15282392de468efd9c59f973916a57069c14f2c5145bd83b6\n"
}
{
	"stream": "Copying blob sha256:6507c6319c7214ff62fce6992997a2328153d201abcf22fff1fd293154a5668f\n"
}
{
	"stream": "Copying blob sha256:0aa6a876cfe9802249831655b28dcf7c35da8b54ff8eeb5c8951c162939de925\n"
}
{
	"stream": "Copying blob sha256:7679c09af3851a1622782c74864351c296a0d1886813862fd7116383aeba9f07\n"
}
{
	"stream": "Copying blob sha256:a7c5dbee8afd212fc7f1b5b0634a7da82107442823195156ff4ffb8ae7440bef\n"
}
{
	"stream": "Copying blob sha256:2c62e1b053968f9af83a41136fa921a619732aad12edf176593a8d7fc696738f\n"
}
{
	"stream": "Copying config sha256:132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0\n"
}
{
	"stream": "Writing manifest to image destination\n"
}
{
	"stream": "Storing signatures\n"
}
{
	"stream": "Trying to pull quay.io/containers/podman:latest...\nGetting image source signatures\nCopying blob sha256:ef14cb6670acaea6f2129ab854a5074c07445cf109dcf5d7d3aff6ee88387c98\nCopying blob sha256:dbfdc88672b7900f151eac3951c1b4a3824118e123d1caa5e0cbf9c2e3631452\nCopying blob sha256:811fa2fea152d9f15282392de468efd9c59f973916a57069c14f2c5145bd83b6\nCopying blob sha256:6507c6319c7214ff62fce6992997a2328153d201abcf22fff1fd293154a5668f\nCopying blob sha256:0aa6a876cfe9802249831655b28dcf7c35da8b54ff8eeb5c8951c162939de925\nCopying blob sha256:7679c09af3851a1622782c74864351c296a0d1886813862fd7116383aeba9f07\nCopying blob sha256:a7c5dbee8afd212fc7f1b5b0634a7da82107442823195156ff4ffb8ae7440bef\nCopying blob sha256:2c62e1b053968f9af83a41136fa921a619732aad12edf176593a8d7fc696738f\nCopying config sha256:132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0\nWriting manifest to image destination\nStoring signatures\n",
	"images": [
		"132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"
	],
	"id": "132408d244fbfdbc6a92219d3543d9103b27af515cb5834e3828b6619dc40cd0"
}

be good?

@mheon
Copy link
Member

mheon commented Jun 11, 2021

Should we include the stream parameter in the final message? @jwhonce

@sshnaidm
Copy link
Member Author

Just a note about missing 404 error, the podman-py expects exactly for 404 to raise exception about non pulled image:
https://github.com/containers/podman-py/blob/850f97cef0867e3ba1a383d7c2a4068b95849de9/podman/domain/images_manager.py#L303-L304

response = self.client.post("/images/pull", params=params)
response.raise_for_status(not_found=ImageNotFound)

@jwhonce
Copy link
Member

jwhonce commented Jun 23, 2021

@sshnaidm The HTTP status code is problematic here. If streaming straight from c/images (as currently written), we write to the client before knowing the final results.

@cdoern I do not like seeing all the status messages in one string. That is going to break clients who have built state machines around the expected output stanzas.

One implementation, could be to buffer the channel output from c/image in the handler and then present it as expected to the clients and with a better status code. That only burns memory in the service.

/cc @mheon

@cdoern
Copy link
Contributor

cdoern commented Jun 24, 2021

@jwhonce do you suggest I exclude the stream in the final output but keep the new quiet param? that would eliminate the single string in the final report but still give the functionality to exclude the ongoing stream. Or I could also add another param to explicitly include the stream output in the final report, I feel like adding explicit features won't break compatibility because pre existing client code won't know the difference.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 25, 2021

@jwhonce @cdoern What is the latest on this issue?

@cdoern
Copy link
Contributor

cdoern commented Jul 25, 2021

@rhatdan I have the code ready to go to implement what the user wants but I think @jwhonce is concerned about the breakage of current applications depending on the output as is, and the compatibility issues in terms of differing output. This might be a case where, for compatibility we can't change much. I am not sure though, @jwhonce what do you think?

@rhatdan
Copy link
Member

rhatdan commented Jul 26, 2021

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

@rhatdan rhatdan added the 4.0 label Jul 26, 2021
@cdoern
Copy link
Contributor

cdoern commented Aug 6, 2021

@rhatdan @jwhonce should I submit a PR for this since we are accepting breaking changes now?

@rhatdan
Copy link
Member

rhatdan commented Aug 6, 2021

Sure.

cdoern pushed a commit to cdoern/podman that referenced this issue Aug 9, 2021
Added quiet param to docs to limit stream output. Formatted JSON.

fixes containers#10612

Signed-off-by: cdoern <[email protected]>
Signed-off-by: cdoern <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants