containers / podman

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

Error when use "image prune --all" via forwarding API and docker cli #20469

Closed philippjenni closed 1 year ago

philippjenni commented 1 year ago

Issue Description

If an image exists in Podman that is no longer in use and the command "docker image prune -a" is executed via the Forward API and Docker CLI, the error message "Error response from daemon: specifying "dangling" filter more than once with different values is not supported" appears. If the command is executed via "podman image prune -a", the cleanup works correctly.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Download Image docker pull nginx
  2. Clean Images docker image prune -a

Describe the results you received

Error Message: Error response from daemon: specifying "dangling" filter more than once with different values is not supported

Describe the results you expected

The image should be removed.

podman info output

host:
  arch: amd64
  buildahVersion: 1.32.0
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.7-2.fc38.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.7, commit: '
  cpuUtilization:
    idlePercent: 99.64
    systemPercent: 0.2
    userPercent: 0.15
  cpus: 4
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: container
    version: "38"
  eventLogger: journald
  freeLocks: 2048
  hostname: VGENERAL96
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.15.133.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 7665016832
  memTotal: 10413207552
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.8.0-1.fc38.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.8.0
    package: netavark-1.8.0-2.fc38.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.8.0
  ociRuntime:
    name: crun
    package: crun-1.10-1.fc38.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.10
      commit: c053c83c57551bca13ead8600237341818975974
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20231004.gf851084-1.fc38.x86_64
    version: |
      pasta 0^20231004.gf851084-1.fc38.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  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: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc38.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 3221225472
  swapTotal: 3221225472
  uptime: 2h 34m 17.00s (Approximately 0.08 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 1081101176832
  graphRootUsed: 2787717120
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 47
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.7.0
  Built: 1695839078
  BuiltTime: Wed Sep 27 20:24:38 2023
  GitCommit: ""
  GoVersion: go1.20.8
  Os: linux
  OsArch: linux/amd64
  Version: 4.7.0

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

Yes

Additional environment details

OS: Windows 2022 WSL version: 2.0.6.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25880.1000-230602-1350.main Windows version: 10.0.20348.1787 Podman Version: 4.7.1 Docker CLI Version 24.0.6, build ed223bc

vrothberg commented 1 year ago

Thanks for reaching out, @philippjenni. I am taking a look.

philippjenni commented 1 year ago

@vrothberg I have tested if the issue is fixed with 4.7.2. The Bug still exists.

vrothberg commented 1 year ago

The fix has not been backported to v4.7.2 but will be released with Podman v4.8 (November).

philippjenni commented 11 months ago

@vrothberg I have tested with 4.8-rc1. Bug still exists

Podman Version

podman -v
podman version 4.8.0-rc1

Output

docker image prune --all
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Error response from daemon: specifying "dangling" filter more than once with different values is not supported

Same error exists when i call

docker system prune -a
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them
  - all build cache

Are you sure you want to continue? [y/N] y
Error response from daemon: specifying "dangling" filter more than once with different values is not supported
vrothberg commented 11 months ago

@philippjenni it works on my end. Are you sure that you pointed the docker client to right binary/socket?

I ran ./bin/podman system service -t0 --log-level=info and then DOCKER_HOST="unix:///run/user/1000/podman/podman.sock" docker image prune --all and do not see the issue anymore. The fix also included regression tests.

philippjenni commented 11 months ago

@vrothberg I run Podman under Windows 2022

philippjenni commented 11 months ago

@vrothberg I have see that my WSL Machine have Podman 4.7.0 installed. I will try update this and then try again. I give you feedback about this.

vrothberg commented 11 months ago

Ah, that explains it. It was a server-side fix, so updating the client won't fix the issue.

philippjenni commented 11 months ago

@vrothberg I have tried to update the WSL Image. But the latest version of the image has version 4.7.2

philippjenni commented 11 months ago

@vrothberg With a manual updated wsl image (test mode) works fix. Thanks for support.