failed to start Docker container with network created by kuryr

Bug #1516539 reported by Clare
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr
Fix Committed
High
Baohua Yang

Bug Description

hi,

follow the steps to create network and start container:
1. create network: sudo docker network create --driver=kuryr foo
2. launches a container against network foo: sudo docker run --net=foo -itd --name=container1 busybox

Error info:
127.0.0.1 - - [16/Nov/2015 08:42:53] "POST /NetworkDriver.CreateEndpoint HTTP/1.1" 200 -
ERROR:root:transaction decorator error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 75, in decorated
    ret = f(self, direct, *argv, **kwarg)
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 398, in __setitem__
    get(key, lambda x, y: x == y)(value, tn[key]):
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/interface.py", line 58, in <lambda>
    _fields_cmp = {'flags': lambda x, y: x & y & IFF_MASK == y & IFF_MASK}
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

ERROR:root:transaction decorator error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 75, in decorated
    ret = f(self, direct, *argv, **kwarg)
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 405, in __delitem__
    self[key] = None
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 85, in decorated
    raise error
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

127.0.0.1 - - [16/Nov/2015 08:42:57] "POST /NetworkDriver.Join HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [16/Nov/2015 08:42:57] "POST /NetworkDriver.Join HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vagrant/kuryr/kuryr/controllers.py", line 586, in network_driver_join
    endpoint_id, neutron_port, all_subnets)
  File "/home/vagrant/kuryr/kuryr/binding.py", line 91, in port_bind
    host_veth.up()
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 213, in __exit__
    self.commit()
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/interface.py", line 477, in commit
    del self[i]
  File "/usr/local/lib/python2.7/dist-packages/pyroute2/ipdb/transactional.py", line 85, in decorated
    raise error
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

could you help check?

Revision history for this message
Mohammad Banikazemi (mb-s) wrote :

There has been significant changes to the code. Please try again and reopen the bug if the issue continues to exist.

Changed in kuryr:
status: New → Invalid
Revision history for this message
Baohua Yang (yangbaohua) wrote :

This happens when u do not start Kuryr service with enough privilege.

Kuryr needs higher privilege to create local veth pair.

I will try to see if we can make some workaround.

Changed in kuryr:
assignee: nobody → Baohua Yang (yangbaohua)
Changed in kuryr:
status: Invalid → In Progress
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to kuryr (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/272370

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to kuryr (master)

Reviewed: https://review.openstack.org/272370
Committed: https://git.openstack.org/cgit/openstack/kuryr/commit/?id=672906eef332b278d7dbe869f2a463ce145a2070
Submitter: Jenkins
Branch: master

commit 672906eef332b278d7dbe869f2a463ce145a2070
Author: Taku Fukushima <email address hidden>
Date: Tue Jan 26 12:46:45 2016 +0900

    Add "sudo" to the instruction for running Kuryr

    This patch adds "sudo" to "Running Kuryr" section of README.rst. Some
    people get stuck with the errors of pyroute2 and that's because of the
    lack of the privilege for manipulating the veth interfaces.

    Related-Bug: #1516539

    Change-Id: I44f44755a1aec4ec29d0afa4852e989eca28d381
    Signed-off-by: Taku Fukushima <email address hidden>

Dongcan Ye (hellochosen)
Changed in kuryr:
status: In Progress → Fix Committed
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.