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 API service returns incorrect JSON (missing Mounts value) for Container List call #12734

Closed
struanb opened this issue Jan 3, 2022 · 1 comment · Fixed by #12735
Closed
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

@struanb
Copy link

struanb commented Jan 3, 2022

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

/kind bug

Description

The Podman API service returns incorrect JSON for a Docker Container List call: specifically, the Mounts property is null but should be populated with an object representing any mountpoints.

Steps to reproduce the issue:

  1. Launch a Podman container i.e. podman run --name test -v /opt:/opt alpine:latest ash -c 'sleep infinity'

  2. Launch the Podman API service i.e. podman system service --time=0 unix:///tmp/podman.sock

  3. Call the Docker Container List API i.e. curl -s --unix-socket /tmp/podman.sock -H "Content-Type: application/json" -X GET "http:/v1.40/containers/json?all=true"

  4. Launch an equivalent Docker container i.e. docker run --name test -v /opt:/opt alpine:latest ash -c 'sleep infinity'

  5. Call the Docker Container List API i.e. curl -s --unix-socket /var/run/docker.sock -H "Content-Type: application/json" -X GET "http:/v1.40/containers/json?all=true"

  6. Compare the results

Describe the results you received:

The Podman API returns JSON contains "Mounts": null.

Describe the results you expected:

i.e.

    "Mounts": [
      {
        "Destination": "/opt",
        "Mode": "",
        "Propagation": "rprivate",
        "RW": true,
        "Source": "/opt",
        "Type": "bind"
      }
    ]

(This value matches that returned by the Podman API for the Container Inspect call i.e. curl -s --unix-socket /tmp/podman.sock -H "Content-Type: application/json" -X GET "http:/v1.40/containers/test/json").

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

Happens consistently.

Output of podman version:

# podman version
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.17.5
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

# podman info --debug
host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - rdma
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: 'conmon: /usr/bin/conmon'
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: unknown'
  cpus: 16
  distribution:
    codename: bullseye
    distribution: debian
    version: "11"
  eventLogger: journald
  hostname: dockside-debian
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.10.0-9-amd64
  linkmode: dynamic
  logDriver: journald
  memFree: 6434574336
  memTotal: 7900307456
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.17
      commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/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: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.4.0
  swapFree: 104853504
  swapTotal: 104853504
  uptime: 38m 27.7s
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 1
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 4
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.17.5
  OsArch: linux/amd64
  Version: 3.4.4

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

# apt list podman
Listing... Done
podman/unstable,now 3.4.4+ds1-1 amd64 [installed]
podman/unstable 3.4.4+ds1-1 i386

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. I'm running Debian Sid version 3.4.4, which matches the latest release. The issue also affected Podman 3.0.1 in Debian Bullseye.

I've checked the troubleshooting guide.

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

Running vanilla Debian Bullseye on a KVM VM with Debian Sid Podman v3.4.4.

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

mheon commented Jan 4, 2022

Being fixed in #12735

rhatdan added a commit to rhatdan/podman that referenced this issue Jan 4, 2022
We are hard coding mounts to return nil in compat API,
since we have the data, we should return it.

Fixes: containers#12734

Signed-off-by: Daniel J Walsh <[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.

2 participants