Neutronclient failures throw unhelpful "Unexpected Exception"

Bug #1653645 reported by Roman Podoliaka
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
Medium
Roman Podoliaka
7.0.x
Fix Released
High
Alexey Stupnikov
8.0.x
Fix Released
Medium
Alexey Stupnikov
9.x
Fix Released
Medium
Roman Podoliaka

Bug Description

Upstream bug: https://bugs.launchpad.net/nova/+bug/1571722

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: added: area-nova
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/nova (9.0/mitaka)

Fix proposed to branch: 9.0/mitaka
Change author: Sahid Orentino Ferdjaoui <email address hidden>
Review: https://review.fuel-infra.org/29639

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Experimental backport for 7.0: https://review.fuel-infra.org/29640

Nazarii Kondra (nkondra)
tags: added: customer-found
Revision history for this message
Denis Klepikov (dklepikov) wrote :

High for MOS 7.0 due to customer-found

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/nova (9.0/mitaka)

Reviewed: https://review.fuel-infra.org/29639
Submitter: Pkgs Jenkins <email address hidden>
Branch: 9.0/mitaka

Commit: 932512b7525f8822fb88c7345483a540ea7f80c0
Author: Sahid Orentino Ferdjaoui <email address hidden>
Date: Fri Jan 13 10:04:37 2017

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.

Closes-Bug: #1653645

(cherry-picked from commit 80d39a65062a424c9efe42257a38a09c6af2f3e9)
Change-Id: I87c8b86373967639eb55b4cc3b7d6cbd9780f3ac

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/python-neutronclient (openstack-ci/fuel-7.0/2015.1.0)

Fix proposed to branch: openstack-ci/fuel-7.0/2015.1.0
Change author: Akihiro Motoki <email address hidden>
Review: https://review.fuel-infra.org/29933

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/python-neutronclient (openstack-ci/fuel-8.0/liberty)

Fix proposed to branch: openstack-ci/fuel-8.0/liberty
Change author: Akihiro Motoki <email address hidden>
Review: https://review.fuel-infra.org/30208

tags: added: on-verification
Revision history for this message
Vladimir Jigulin (vjigulin) wrote :

Verified on 9.2 snapshot #822

tags: removed: on-verification
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/python-neutronclient (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/29933
Submitter: Denis V. Meltsaykin <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: d43b2ff07971a2c9fd67b75aaa0232b758f42f37
Author: Akihiro Motoki <email address hidden>
Date: Thu Jan 19 09:09:38 2017

Ensure to use exception per status code for all cases

Previously, only when an exception has a content with
{'NeutronError': {'type': xxxx, 'message': xxxx}},
exception per status code is raised from neutronclient library.
There are cases where this kind of message is not contained
in exception messages, for example, some extension is loaded.

Library users expect an exception is raised based on response
status code and it should not depend on an exception message.
This commit applies a fallback logic to map generic per-status
exception to all exception types from the neutron server.

Closes-Bug: #1653645

(cherry-picked from af1a55bfd2e47b0e3cd8349f0a9b1277474fee18)
Change-Id: Ib3d0a8359aed444b12217b3404d40443d61fc2c0

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/nova (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/29640
Submitter: Denis V. Meltsaykin <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: 1058243ac69e1488148a408584f2337fa923389c
Author: Sahid Orentino Ferdjaoui <email address hidden>
Date: Thu Jan 19 11:38:46 2017

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.

Closes-Bug: #1653645

(cherry-picked from 932512b7525f8822fb88c7345483a540ea7f80c0)
Change-Id: I87c8b86373967639eb55b4cc3b7d6cbd9780f3ac

tags: added: on-verification
Revision history for this message
Vladimir Jigulin (vjigulin) wrote :

Verified on mos7.0 + mu7 proposed

tags: removed: on-verification
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/python-neutronclient (openstack-ci/fuel-8.0/liberty)

Reviewed: https://review.fuel-infra.org/30208
Submitter: Pkgs Jenkins <email address hidden>
Branch: openstack-ci/fuel-8.0/liberty

Commit: dc501420ad86338faf5c276cc6c184b057e975a9
Author: Akihiro Motoki <email address hidden>
Date: Wed Jun 28 13:19:02 2017

Ensure to use exception per status code for all cases

Previously, only when an exception has a content with
{'NeutronError': {'type': xxxx, 'message': xxxx}},
exception per status code is raised from neutronclient library.
There are cases where this kind of message is not contained
in exception messages, for example, some extensions are loaded.

Library users expect an exception is raised based on response
status code and it should not depend on an exception message.
This commit applies a fallback logic to map generic per-status
exception to all exception types from the neutron server.

Closes-Bug: #1653645

(cherry-picked from af1a55bfd2e47b0e3cd8349f0a9b1277474fee18)
Change-Id: Ib3d0a8359aed444b12217b3404d40443d61fc2c0

Revision history for this message
Ilya Bumarskov (ibumarskov) wrote :

Verified on Fuel 8.0 MU-5

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.