← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1823203] Re: PortLimitExceeded results in 500 error from POST /servers/{server_id}/os-interface

 

Yup I was able to easily recreate this in devstack:

g [None req-124eeb28-2f0f-4b47-b2c0-3889d65dd931 admin admin] 199.204.45.68 "POST /compute/v2.1/servers/8e90f1f0-e8dd-4783-8bb3-ec8d594e60f1/os-interface" status: 500 len: 1
9.204.45.68 () {64 vars in 1385 bytes} [Thu Apr  4 18:23:37 2019] POST /compute/v2.1/servers/8e90f1f0-e8dd-4783-8bb3-ec8d594e60f1/os-interface => generated 198 bytes in 2046
 ESCOD
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/compute/manager.py", line 201, in decorated_function
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     return function(self, context, *args, **kwargs)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/compute/manager.py", line 6081, in attach_interface
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     bind_host_id=bind_host_id, tag=tag)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/network/neutronv2/api.py", line 1697, in allocate_port_for_in
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     bind_host_id=bind_host_id, attach=True)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/network/neutronv2/api.py", line 1106, in allocate_for_instanc
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     security_group_ids)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/network/neutronv2/api.py", line 1013, in _create_ports_for_in
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     neutron, instance, created_port_ids)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exi
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     self.force_reraise()
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     six.reraise(self.type_, self.value, self.tb)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/network/neutronv2/api.py", line 1002, in _create_ports_for_in
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     request.address, security_group_ids)
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi   File "/opt/stack/nova/nova/network/neutronv2/api.py", line 565, in _create_port_minimal
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi     raise exception.PortLimitExceeded()
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi PortLimitExceeded: Maximum number of ports exceeded
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: ERROR nova.api.openstack.wsgi 
Apr 04 18:23:39 train devstack@n-api.service[12332]: INFO nova.api.openstack.wsgi [None req-124eeb28-2f0f-4b47-b2c0-3889d65dd931 admin admin] HTTP exception thrown: Unexpect
Apr 04 18:23:39 train devstack@n-api.service[12332]: <class 'PortLimitExceeded_Remote'>
Apr 04 18:23:39 train devstack@n-api.service[12332]: DEBUG nova.api.openstack.wsgi [None req-124eeb28-2f0f-4b47-b2c0-3889d65dd931 admin admin] Returning 500 to user: Unexpec
Apr 04 18:23:39 train devstack@n-api.service[12332]: <class 'PortLimitExceeded_Remote'> {{(pid=12334) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:943}}


** Changed in: nova
     Assignee: (unassigned) => Matt Riedemann (mriedem)

** Changed in: nova
   Importance: Undecided => Medium

** Changed in: nova
       Status: New => Confirmed

** Also affects: nova/stein
   Importance: Undecided
       Status: New

** Also affects: nova/queens
   Importance: Undecided
       Status: New

** Also affects: nova/pike
   Importance: Undecided
       Status: New

** Also affects: nova/rocky
   Importance: Undecided
       Status: New

** Changed in: nova/pike
       Status: New => Confirmed

** Changed in: nova/rocky
       Status: New => Confirmed

** Changed in: nova/pike
   Importance: Undecided => Medium

** Changed in: nova/queens
   Importance: Undecided => Medium

** Changed in: nova/stein
       Status: New => Confirmed

** Changed in: nova/stein
   Importance: Undecided => Medium

** Changed in: nova/rocky
   Importance: Undecided => Medium

** Changed in: nova/queens
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1823203

Title:
  PortLimitExceeded results in 500 error from POST /servers/{server_id
  }/os-interface

Status in OpenStack Compute (nova):
  Confirmed
Status in OpenStack Compute (nova) pike series:
  Confirmed
Status in OpenStack Compute (nova) queens series:
  Confirmed
Status in OpenStack Compute (nova) rocky series:
  Confirmed
Status in OpenStack Compute (nova) stein series:
  Confirmed

Bug description:
  This is based on code inspection at the moment, but attaching an
  interface (port) to a server by providing a network and having nova-
  compute create the port on that network can result in an over-quota
  failure from neutron:

  https://github.com/openstack/nova/blob/6ebb2c4cae65cb437e17a8c02fe5174a9825d8e0/nova/network/neutronv2/api.py#L565

  Which is not handled in the API controller:

  https://github.com/openstack/nova/blob/6ebb2c4cae65cb437e17a8c02fe5174a9825d8e0/nova/api/openstack/compute/attach_interfaces.py#L168

  So it will result in a 500 response from the API when it should really
  be something like 403.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1823203/+subscriptions


References