Couldn't get docker plugin to work

Bug #1703698 reported by hongbin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-libnetwork
Confirmed
Undecided
Liping Mao

Bug Description

In Ubuntu 16.04 that has devstack running and docker installed (via devstack-plugin-container), I couldn't create a container from kuryr plugin. Steps to reproduce:

$ git clone https://git.openstack.org/openstack/kuryr-libnetwork
$ cd kuryr-libnetwork
$ ./contrib/docker/v2plugin/v2plugin_rootfs.sh
$ docker plugin create kuryr/libnetwork2 ./
$ docker plugin enable kuryr/libnetwork2
$ wget -O create_from_private_net.sh https://gist.githubusercontent.com/hongbin/2567a26ee3cb338ca7ae6e2d5da5cac9/raw/f2952072cf7b718129a1728fa3bc1336e2225f08/create-from-private-net.sh
$ bash create_from_private_net.sh
WARNING: setting legacy OS_TENANT_NAME to support cli tools.
ad18b436efc88dc3a9474ee92e4820f6e84ad7e4f3557fd27605491220b3a730
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
5fca2a46fd18c0600562448bac3a8f745868198de62a5716fbf691eb1a076f70
docker: Error response from daemon: failed to create endpoint dazzling_carson on network testnet: NetworkDriver.CreateEndpoint: Could not configure the container virtual device networking..

Here is a snippet in the docker logs: http://paste.openstack.org/show/615081/

hongbin (hongbin034)
summary: - Could get docker plugin to work
+ Couldn't get docker plugin to work
Revision history for this message
Liping Mao (limao) wrote :

@hongbin, I'm trying to re-produce this problem.

while use latest devstack-plugin-container install docker, I get the follwoing error:
root@devstack:/vagrant# uname -a
Linux devstack 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@devstack:/vagrant# curl -fsSL https://download.docker.com/linux/ubuntu/gpg
curl: (6) Could not resolve host: download.docker.com

Looks like I get similar problem with:
http://www.ttlsa.com/linux/curl-6-couldnt-resolve-host/

When I add '-4' it works for me(use ipv4):
root@devstack:/vagrant# curl -fsSL4 https://download.docker.com/linux/ubuntu/gpg

Did you get same problem before?
my vm is using : ubuntu/xenial64 20170503.1.0

Thanks, I will skip this problem manually to go on research your problem this week.

Revision history for this message
hongbin (hongbin034) wrote :

Hi Liping,

I didn't encounter this problem. Here is my environment:

$ uname -a
Linux testkuryr 4.4.0-79-generic #100-Ubuntu SMP Wed May 17 19:58:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

However, welcome to patch the devstack-plugin-container if you have a chance .

Revision history for this message
Liping Mao (limao) wrote :

@hongbin, I can reproduce this problem, I find the problem is when run "iface.add_ip('fd34:d27c:33d3:0:f816:3eff:fe3f:8693', 64)"

If I only run iface.add_ip IPV4, it works:
>>> import pyroute2
>>>
>>> ip = pyroute2.IPDB()
>>> with ip.interfaces['tap1e510214-51'] as iface:
... iface.add_ip('10.0.0.8', 26)
...
{'family': 0, 'txqlen': 1000, 'ipdb_scope': 'system', 'index': 20, 'operstate': 'LOWERLAYERDOWN', 'num_tx_queues': 1, 'group': 0, 'carrier_changes': 3, 'ipaddr': (('fe80::fcda:a6ff:fe93:e328', 64), ('10.0.0.8', 26)), 'neighbours': (), 'ifname': 'tap1e510214-51', 'promiscuity': 0, 'linkmode': 0, 'broadcast': 'ff:ff:ff:ff:ff:ff', 'link': 19, 'address': 'fe:da:a6:93:e3:28', 'vlans': (), 'ipdb_priority': 0, 'kind': 'veth', 'qdisc': 'noqueue', 'mtu': 1500, 'num_rx_queues': 1, 'carrier': 0, 'flags': 3, 'ifi_type': 1, 'proto_down': 0, 'ports': ()}
>>>

If I add IPV6, it failed

>>> import pyroute2
>>>
>>> ip = pyroute2.IPDB()
>>> with ip.interfaces['tap1e510214-51'] as iface:
... #iface.add_ip('10.0.0.8', 26)
... iface.add_ip('fd34:d27c:33d3:0:f816:3eff:fe3f:8693', 64)
...
{'family': 0, 'txqlen': 1000, 'ipdb_scope': 'system', 'index': 20, 'operstate': 'LOWERLAYERDOWN', 'num_tx_queues': 1, 'group': 0, 'carrier_changes': 3, 'ipaddr': (('fe80::fcda:a6ff:fe93:e328', 64), ('10.0.0.8', 26)), 'neighbours': (), 'ifname': 'tap1e510214-51', 'promiscuity': 0, 'linkmode': 0, 'broadcast': 'ff:ff:ff:ff:ff:ff', 'link': 19, 'address': 'fe:da:a6:93:e3:28', 'vlans': (), 'ipdb_priority': 0, 'kind': 'veth', 'qdisc': 'noqueue', 'mtu': 1500, 'num_rx_queues': 1, 'carrier': 0, 'flags': 3, 'ifi_type': 1, 'proto_down': 0, 'ports': ()}
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/lib/python2.7/site-packages/pyroute2/ipdb/transactional.py", line 209, in __exit__
    self.commit()
  File "/usr/lib/python2.7/site-packages/pyroute2/ipdb/interfaces.py", line 1057, in commit
    raise error
pyroute2.ipdb.exceptions.CommitException: ipaddr target is not set

Revision history for this message
Liping Mao (limao) wrote :

@hongbin,
BTW, same command can success when I run directly on host, it failed when I run in plugin container. Need to further debug.

Revision history for this message
Liping Mao (limao) wrote :

@hongbin,

Here is what I find right now.

I use the following code run at host directly and in plugin container, it success in host, but failed in plugin container.

Here is code:
root@devstack:~# cat a.py
import pyroute2

ip = pyroute2.IPDB()
with ip.interfaces['tap1e510214-51'] as iface:
    iface.add_ip('fd34:d27c:33d3:0:f816:3eff:fe3f:8693/64')

I find if I run the code in side plugin container, I see the IPV6 is setted on interface, but it is fd34:d27c:33d3::f816:3eff:fe3f:8693%32687/64, it is very strange that it has "%32687" there.

Here is output of ifconfig:
tap1e510214-51 Link encap:Ethernet HWaddr FE:DA:A6:93:E3:28
          inet6 addr: fd34:d27c:33d3::f816:3eff:fe3f:8693%32687/64 Scope:Global
          UP BROADCAST MTU:1500 Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:816 (816.0 B) TX bytes:738 (738.0 B)

I need to go on check why it has "%32687" in the IPV6 address.

hongbin (hongbin034)
Changed in kuryr-libnetwork:
status: New → Confirmed
Revision history for this message
hongbin (hongbin034) wrote :

Hi Liping,

Thanks for tracing down the issue. I can confirm that all the tap interfaces has the strange characters sequence:

# ifconfig tapce248b27-59
tapce248b27-59 Link encap:Ethernet HWaddr 1E:22:16:02:F0:B5
          inet6 addr: fe80::1c22:16ff:fe02:f0b5%32733/64 Scope:Link
          UP BROADCAST MTU:1500 Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:926 (926.0 B) TX bytes:738 (738.0 B)

Revision history for this message
Liping Mao (limao) wrote :

@hongbin,

Sorry for the delay, after debug, I find this is a bug[1] in pyroute 0.4.18, it has been fixed in 0.4.19. I manually upgrade pyroute in pluginv2 container, it works for me with your script:

root@devstack:/home/vagrant/devstack# docker run -itd --net=testnet --ip=$IP --ip6=$IP6 nginx
a3f6d81e7776633347bf81711f43ff59d7f9725ed13926356475f68e094e6d63

[1]https://github.com/svinota/pyroute2/commit/e576eb45a750bd9f0049dfe25a0cc714fefbb988

Regards,
Liping Mao

Revision history for this message
Liping Mao (limao) wrote :

@Hongbin,

Since the latest pyroute2 is 0.4.19 now(Released on 2017-08-01), the pyroute2 in global requirements is > 0.4.17, so can you try rebuild the pluginv2 image? 0.4.19 should already fix the problem.

Not sure if we need to update in global requirement, something like:
pyroute2 > 0.4.17 != 0.4.18

Thoughts?

Regards,
Liping Mao

Changed in kuryr-libnetwork:
assignee: nobody → Liping Mao (limao)
Revision history for this message
hongbin (hongbin034) wrote :

Hi Liping,

I can confirm that plugin-rebuild can resolve the original error. The newly built plugin has 0.4.19 so it looks the problem is possibly related to 0.4.18. Thanks for your trouble-shooting and providing this information. I think it is a good idea to ban 0.4.18 in global requirements, but the requirement repo is freeze now.

After resolving the original issue, it seems I can go further but hit another issue on port binding:

  $ bash create_from_private_net.sh
  WARNING: setting legacy OS_TENANT_NAME to support cli tools.
  ae94fc83bc729d6a3731e2305c5b8dd78173b03f0f2530a68594c1ce8de2935b
  neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
  c7aea0c39c501317a6a951a4f73a546c1ce3028b67766332cb15307ca27f987a
  docker: Error response from daemon: failed to create endpoint zealous_fermat on network testnet:
  NetworkDriver.CreateEndpoint: vif_type(ovs) is not supported. A binding script for this type can't be found.

I can look into the issue once I have a chance. Please let me know if you happen to know how to resolve that error as well :). Appreciate your help.

Revision history for this message
Liping Mao (limao) wrote :

Hi Hongbin,

This is a configuration problem, since pluginv2 will load configuration in /etc/kuryr/kuryr.conf .
Please double check , it should be:
[DEFAULT]
bindir = /usr/libexec/kuryr

The default value in ubuntu is bindir = /usr/local/libexec/kuryr, this do not works in pluginv2, since in the image, the bind scripts are in /usr/libexec/kuryr.

You need to update kuryr.conf, and restart pluginv2 . This should fix your problem.

Regards,
Liping Mao

Revision history for this message
hongbin (hongbin034) wrote :

Thanks Liping,

After fixing the config file, it works very well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.