← 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

 

Reviewed:  https://review.opendev.org/650097
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8ff0fae42bce9f98fd5897888c3c4c739b4b5f45
Submitter: Zuul
Branch:    master

commit 8ff0fae42bce9f98fd5897888c3c4c739b4b5f45
Author: Matt Riedemann <mriedem.os@xxxxxxxxx>
Date:   Thu Apr 4 14:44:02 2019 -0400

    Handle PortLimitExceeded in POST /servers/{server_id}/os-interface
    
    When attaching an interface to a server, if an existing port is not
    specified, nova-compute will attempt to create a port on either the
    user-specified network or the network that is available to the tenant.
    
    If the tenant exceeds their port quota in neutron, a PortLimitExceeded
    exception is raised up from nova-compute [1] which is not being handled
    in the API controller code - which is fixed in this change.
    
    Note that this is one of the few synchronous RPC call operations [2]
    in the compute API so exceptions from the compute service will leak
    back to the API like in this case and need to be handled to avoid a
    500 response to the user.
    
    The 403 response used here matches how PortLimitExceeded is handled in
    the server create API [3].
    
    [1] https://github.com/openstack/nova/blob/6ebb2c4ca/nova/network/neutronv2/api.py#L565
    [2] https://github.com/openstack/nova/blob/6ebb2c4ca/nova/compute/rpcapi.py#L489
    [3] https://github.com/openstack/nova/blob/6ebb2c4ca/nova/api/openstack/compute/servers.py#L688
    
    Change-Id: I5687480a22542eea31d299442837bd64bf731285
    Closes-Bug: #1823203


** Changed in: nova
       Status: In Progress => Fix Released

-- 
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):
  Fix Released
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