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

API list networks returns "null" instead of empty array when used with no networks #10495

Closed
arctic-alpaca opened this issue May 28, 2021 · 5 comments · Fixed by #10518
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

@arctic-alpaca
Copy link
Contributor

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

/kind bug

Description

The list volumes API endpoint returns [] when called with no volumes, list networks returns null when used with no networks. According to the API docs, the behavior should be similar.

Steps to reproduce the issue:

  1. podman system service unix:///home/`whoami`/testing.sock --log-level=debug --time=500

  2. curl --unix-socket /home/`whoami`/testing.sock http://d/v3.2.0/libpod/networks/json
    null
    

Describe the results you received:
null

Describe the results you expected:
[] - an emtpy array.

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

Output of podman version:

Version:      3.2.0-dev
API Version:  3.2.0-dev
Go Version:   go1.15.10
Git Commit:   6ff56ab50a10e2350013c4ff1bf4b8d5d7b5aa87-dirty
Built:        Tue Jan  1 01:00:00 1980
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.20.1-dev
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 12
  distribution:
    distribution: debian
    version: "10"
  eventLogger: file
  hostname: DESKTOP
  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.4.72-microsoft-standard-WSL2
  linkmode: static
  memFree: 12503470080
  memTotal: 13346447360
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.18.1-7931a-dirty
      commit: 7931a1eab0590eff4041c1f74e2844b297c31cea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /tmp/podman-run-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: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.4
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 51m 52.44s
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/alpaca/.config/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 0
    stopped: 4
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: 'fuse-overlayfs: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.4.1
        fuse-overlayfs: version 1.4
        FUSE library version 3.4.1
        using FUSE kernel interface version 7.27
  graphRoot: /home/alpaca/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 15
  runRoot: /tmp/podman-run-1000/containers
  volumePath: /home/alpaca/.local/share/containers/storage/volumes
version:
  APIVersion: 3.2.0-dev
  Built: 315532800
  BuiltTime: Tue Jan  1 01:00:00 1980
  GitCommit: 6ff56ab50a10e2350013c4ff1bf4b8d5d7b5aa87-dirty
  GoVersion: go1.15.10
  OsArch: linux/amd64
  Version: 3.2.0-dev

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

Static build from here.

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)

Checked troubleshooting guide, didn't find any static builds from CI besides the one from the 3.1.2 release I downloaded earlier.

Additional environment details (AWS, VirtualBox, physical, etc.):
Windows 10, 64bit, WLS2, Debian 10

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

Thanks for reaching out!

@cdoern, are you interested in tackling the issue?

@cdoern
Copy link
Contributor

cdoern commented Jun 1, 2021

@vrothberg yeah sure! I've been working on another issue with API endpoints for the past few days so I should be able to pick this one up.

@vrothberg
Copy link
Member

Thanks, @cdoern! Feel free to ping me any time if you have a question.

@therealdjryan
Copy link

I am having what appears to be this issue while starting containers with podman-compose. Is there a workaround I can use until this fix is released? I apologize if the answer tis obvious, I am a novice with containers.

@zhangguanzhang
Copy link
Collaborator

I am having what appears to be this issue while starting containers with podman-compose. Is there a workaround I can use until this fix is released? I apologize if the answer tis obvious, I am a novice with containers.

https://github.com/containers/podman/pull/10658/files#diff-68d24fa81558aae3d8c59e2aa57a4fa719ea3b04d7fa14beff45f16f00858f50R21
could use the latest version v3.2.1

@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
5 participants