Neutronclient failures throw unhelpful "Unexpected Exception"

Bug #1571722 reported by Augustina Ragwitz
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Sahid Orentino

Bug Description

We are seeing some bug reports coming in where users experience an "Unexpected Exception" error when neutronclient fails. This is not particularly helpful for anyone experiencing this issue and it would be nice to have something more specific to aid in troubleshooting.

We could arguably blanket wrap all connection failures from neutronclient in nova.network.neutronv2.api and raise those up as something more specific. See cinderclient usage in nova, for example.

like https://github.com/openstack/python-neutronclient/blob/master/neutronclient/common/exceptions.py#L204 or https://github.com/openstack/python-neutronclient/blob/master/neutronclient/common/exceptions.py#L109

Tags: api neutron
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Augustina Ragwitz (auggy) wrote :

See this bug for an example of a reported issue - https://bugs.launchpad.net/nova/+bug/1563513

Revision history for this message
Matt Riedemann (mriedem) wrote :

Yeah, we should wrap neutronclient calls and handle 401/403 type errors with the appropriate NovaException which are handled in the REST API so we don't spew 500s for misconfiguration or auth issues.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Bug 1567655 is also related to this. It turns out that the neutron security group driver in nova is doing direct calls to the python-neutronclient rather than using our network API abstraction in nova.network.neutronv2.api.API. The problem with this is if we added error handling to the neutron API wrapper that we have, the security group driver for neutron doesn't benefit from that.

Revision history for this message
Matt Riedemann (mriedem) wrote :

This gets a bit weird, at least for bug 1567655, because in that case the error comes from keystoneauth (the ConnectFailed exception) because the auth values in nova.conf for neutron are wrong, so the request connection fails.

python-neutronclient doesn't handle that error from keystoneauth so nova would have to handle both, if it's going to handle both.

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

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

Revision history for this message
Matt Riedemann (mriedem) wrote :

sahid has a related change here: https://review.openstack.org/#/c/312014/

Changed in nova:
assignee: nobody → sahid (sahid-ferdjaoui)
status: Confirmed → In Progress
Changed in nova:
assignee: sahid (sahid-ferdjaoui) → Prateek Arora (parora)
Changed in nova:
assignee: Prateek Arora (parora) → sahid (sahid-ferdjaoui)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/312014
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=80d39a65062a424c9efe42257a38a09c6af2f3e9
Submitter: Jenkins
Branch: master

commit 80d39a65062a424c9efe42257a38a09c6af2f3e9
Author: Sahid Orentino Ferdjaoui <email address hidden>
Date: Tue May 3 06:54:21 2016 -0400

    network: handle unauthorized exception from neutron

    Neutron can raise an unauthorized exception for an expired or invalid
    token. In case of admin context we log a message to inform operators
    that the Neutron admin creadential are not well configured then return
    a 500 to user. In case of user context we return 401.

    Change-Id: I87c8b86373967639eb55b4cc3b7d6cbd9780f3ac
    Closes-Bug: #1571722

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/309550

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.0.0b3

This issue was fixed in the openstack/nova 14.0.0.0b3 development milestone.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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