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 REST API fails for macvlan network #10266

Closed
vikas-goel opened this issue May 7, 2021 · 19 comments · Fixed by #10919
Closed

podman REST API fails for macvlan network #10266

vikas-goel opened this issue May 7, 2021 · 19 comments · Fixed by #10919
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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. network Networking related issue or feature

Comments

@vikas-goel
Copy link
Contributor

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

/kind bug

Description

When podman REST API is invoked for default podman network, then the API response is good as expected. However, when the same API is invoked for a macvan network, it fails.

As a result the Docker Compose (podman-docker) fails to work.

Steps to reproduce the issue:

  1. Create a macvlan network
# podman network ls
NAME    VERSION  PLUGINS
podman  0.4.0    bridge,portmap,firewall,tuning
ens160  0.4.0    macvlan
#
  1. Run podman REST API using curl command for podman and ens160 networks separately
# curl --unix-socket /run/podman/podman.sock http://localhost/_ping
OK

# curl --unix-socket /run/podman/podman.sock http://localhost/networks/podman
{"Name":"podman","Id":"2f259bab93aaaaa2542ba43ef33eb990d0999ee1b9924b557b7be53c0b7a1bb9","Created":"2021-05-04T21:01:07.495305062-07:00","Scope":"local","Driver":"bridge","EnableIPv6":false,"IPAM":{"Driver":"default","Options":null,"Config":[{"Subnet":"10.88.0.0/16","Gateway":"10.88.0.1"}]},"Internal":false,"Attachable":false,"Ingress":false,"ConfigFrom":{"Network":""},"ConfigOnly":false,"Containers":{"0db48af1948a452fe945b0572c31165eb084cf6f86399c4b9802cc9c4d472916":{"Name":"podman","EndpointID":"","MacAddress":"","IPv4Address":"","IPv6Address":""},"21f03f0efda84f3cb745ccf7ef6b4064f298bcd0539da30c19e9bf08309b4a2c":{"Name":"podman","EndpointID":"","MacAddress":"","IPv4Address":"","IPv6Address":""},"a7403e211cda0b0a6c6fe1771e67903cb9556c0eda7ebc8deb1ae7204ffc8482":{"Name":"podman","EndpointID":"","MacAddress":"","IPv4Address":"","IPv6Address":""}},"Options":null,"Labels":null}

# curl --unix-socket /run/podman/podman.sock http://localhost/networks/ens160
{"cause":"unable to find bridge plugin","message":"unable to find bridge plugin","response":500}
#

Describe the results you received:

# curl --unix-socket /run/podman/podman.sock http://localhost/networks/ens160
{"cause":"unable to find bridge plugin","message":"unable to find bridge plugin","response":500}
#

Describe the results you expected:
The result should be similar to what the API responds for podman network in lieu of ens160

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

Output of podman version:

Version:      3.0.2-dev
API Version:  3.0.0
Go Version:   go1.15.7
Built:        Tue Mar  2 07:10:06 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.19.4
  cgroupManager: systemd
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.26-1.module+el8.4.0+10198+36d1d0e3.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.26, commit: 0a5175681bdd52b99f1f0f442cbba8f8c126a1c9'
  cpus: 8
  distribution:
    distribution: '"rhel"'
    version: "8.4"
  eventLogger: file
  hostname: flex-vm-02.dc2.ros2100.veritas.com
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.18.0-293.el8.x86_64
  linkmode: dynamic
  memFree: 4322971648
  memTotal: 33511845888
  ociRuntime:
    name: runc
    package: runc-1.0.0-70.rc92.module+el8.4.0+10198+36d1d0e3.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.2-dev'
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_NET_RAW,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
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 16921104384
  swapTotal: 16924012544
  uptime: 62h 33m 19.9s (Approximately 2.58 days)
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 5
    paused: 0
    running: 2
    stopped: 3
  graphDriverName: overlay
  graphOptions:
    overlay2.size: 10G
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 3
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.0.0
  Built: 1614697806
  BuiltTime: Tue Mar  2 07:10:06 2021
  GitCommit: ""
  GoVersion: go1.15.7
  OsArch: linux/amd64
  Version: 3.0.2-dev

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

podman-3.0.1-3.module+el8.4.0+10198+36d1d0e3.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.):
Red Hat Enterprise Linux 8.4 Beta
VMware virtual machine

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

mheon commented May 9, 2021 via email

@vikas-goel
Copy link
Contributor Author

vikas-goel commented May 9, 2021

Podman 3.1.0 has same behavior

# podman -v
podman version 3.1.0-dev
# podman network ls
NETWORK ID    NAME    VERSION  PLUGINS
2f259bab93aa  podman  0.4.0    bridge,portmap,firewall,tuning
39093c071800  ens160  0.4.0    macvlan
22e496b0a5ff  ens192  0.4.0    macvlan
# curl --unix-socket /run/podman/podman.sock http://localhost/networks/podman
{"Name":"podman","Id":"2f259bab93aaaaa2542ba43ef33eb990d0999ee1b9924b557b7be53c0b7a1bb9","Created":"2021-05-09T11:34:35.028404132-07:00","Scope":"local","Driver":"bridge","EnableIPv6":false,"IPAM":{"Driver":"default","Options":{},"Config":[{"Subnet":"10.88.0.0/16","Gateway":"10.88.0.1"}]},"Internal":false,"Attachable":false,"Ingress":false,"ConfigFrom":{"Network":""},"ConfigOnly":false,"Containers":{"0db48af1948a452fe945b0572c31165eb084cf6f86399c4b9802cc9c4d472916":{"Name":"podman","EndpointID":"","MacAddress":"","IPv4Address":"","IPv6Address":""},"1f3b44d311709a604463d3ab5b8e357c2f7f986438817fc5189ebe68d47b30af":{"Name":"podman","EndpointID":"","MacAddress":"","IPv4Address":"","IPv6Address":""},"a7403e211cda0b0a6c6fe1771e67903cb9556c0eda7ebc8deb1ae7204ffc8482":{"Name":"podman","EndpointID":"","MacAddress":"","IPv4Address":"","IPv6Address":""}},"Options":{},"Labels":{}}
# curl --unix-socket /run/podman/podman.sock http://localhost/networks/ens160
{"cause":"unable to find bridge plugin","message":"unable to find bridge plugin","response":500}
# curl --unix-socket /run/podman/podman.sock http://localhost/networks/ens192
{"cause":"unable to find bridge plugin","message":"unable to find bridge plugin","response":500}
#

@mheon
Copy link
Member

mheon commented May 10, 2021 via email

@vikas-goel
Copy link
Contributor Author

vikas-goel commented May 10, 2021

Hi @mheon ,
The centos-stream provides that version. Any idea where I can find podman-3.1.2 packages for CentOS 8/RHEL 8.4?

@mheon
Copy link
Member

mheon commented May 10, 2021 via email

@jwhonce jwhonce assigned jwhonce and unassigned jwhonce May 10, 2021
@jwhonce
Copy link
Member

jwhonce commented May 10, 2021

@mheon Currently the compatibility layer is hard coded to bridge for the plugin type,
https://github.com/containers/podman/blob/master/pkg/api/handlers/compat/networks.go#L102

I want to talk to @baude before digging into changing this code.

@vikas-goel
Copy link
Contributor Author

Thank you @jwhonce . With your finding I assume I don’t have to try on another version.

@jwhonce
Copy link
Member

jwhonce commented May 11, 2021

@vikas-goel Correct. It will be fixed in some future version of Podman.

@vikas-goel
Copy link
Contributor Author

Thanks @jwhonce and @mheon. Is it possible to get a fix in podman-3.2?

@vikas-goel
Copy link
Contributor Author

Now that podman 3.2 is released, wanted to check if this one can make to next release?

@Luap99 Luap99 added the network Networking related issue or feature label Jun 21, 2021
@vikas-goel
Copy link
Contributor Author

Could someone set the “In Progress” label and assign this to me?

@mheon mheon added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Jul 13, 2021
@vikas-goel
Copy link
Contributor Author

The issue is auto closed but the label still says in progress.

@mheon
Copy link
Member

mheon commented Jul 15, 2021

We only really care about the label for open issues so this is fine.

@Trashmee
Copy link

Trashmee commented Jul 17, 2021

@vikas-goel : Your commit 10919 made it to 3.2.3, I believe, but I'm still seeing issues in this area, could you verify?

#  podman version
Version:      3.2.3
API Version:  3.2.3
Go Version:   go1.16.5
Git Commit:   1e6fd46e91b21342f9454cf8105a92b90e398c52
Built:        Fri Jul 16 22:25:35 2021
OS/Arch:      linux/amd64
#  docker-compose down; docker-compose up -d
ERROR: unable to find bridge plugin
ERROR: unable to find bridge plugin
#  curl --unix-socket /run/podman/podman.sock http://localhost/networks/macvlannet
{"cause":"unable to find bridge plugin","message":"unable to find bridge plugin","response":500}
#  podman run -it --rm --network macvlannet alpine ip addr show eth0
2: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 72:5f:d1:3a:30:43 brd ff:ff:ff:ff:ff:ff
    inet 192.168.183.6/20 brd 192.168.191.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::705f:d1ff:fe3a:3043/64 scope link tentative
       valid_lft forever preferred_lft forever

This is plain fedora 34 + self build 4.2.3 podman.

Kind regards,
ItsMee

@vikas-goel
Copy link
Contributor Author

vikas-goel commented Jul 17, 2021

@Trashmee ,

My fix takes care of compat GET API, not PUT/POST.
Could you create a macvlan network using podman network create --driver macvlan command and then try the compat REST API?

@Trashmee
Copy link

Hi @vikas-goel ,

quick reply, thanks. Can you elaborate the difference between compat GET vs. PUT/POST and how to query?
The curl query I used is from your post #1 in this ticket - which I hoped would was causing my issues with docker-compose and macvlan.

#  podman network create --driver macvlan macvlan1
/etc/cni/net.d/macvlan1.conflist
#  curl --unix-socket /run/podman/podman.sock http://localhost/networks/macvlan1
{"cause":"unable to find bridge plugin","message":"unable to find bridge plugin","response":500}

ItsMee

@vikas-goel
Copy link
Contributor Author

The 3.2.3 release doesn’t seem to have my fix.
https://github.com/containers/podman/blob/v3.2.3/pkg/api/handlers/compat/networks.go

@Trashmee
Copy link

Trashmee commented Jul 17, 2021

You're right, @vikas-goel - i missread the fact that #10919 is referenced here: v3.2.3...main

I can confirm your fix solves my issue when applied manually against the 4.2.3 source. Thanks a lot - great job!

ItsMee

#  docker-compose down; docker-compose up -d
Removing iot-mqtt ... done
Network macvlannet is external, skipping
Creating iot-mqtt ... done
#   curl --unix-socket /run/podman/podman.sock http://localhost/networks/macvlan1
{"Name":"macvlan1","Id":"f284f716fb76eabbb8409c7c76fb7ad95df9472e5010c010a810cf0df08f0913","Created":"2021-07-17T02:57:25.850503962+02:00","Scope":"local","Driver":"macvlan","EnableIPv6":false,"IPAM":{"Driver":"macvlan","Options":{},"Config":null},"Internal":false,"Attachable":false,"Ingress":false,"ConfigFrom":{"Network":""},"ConfigOnly":false,"Containers":{},"Options":{},"Labels":{}}
#  podman version
Version:      3.2.3
API Version:  3.2.3
Go Version:   go1.16.5
Git Commit:   1e6fd46e91b21342f9454cf8105a92b90e398c52-dirty
Built:        Sat Jul 17 03:22:28 2021
OS/Arch:      linux/amd64

@vikas-goel
Copy link
Contributor Author

Thank you for the confirmation. I am glad it worked.

@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
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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. network Networking related issue or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants