Include error message in instance faults

Bug #1013350 reported by Bill Darbie
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Davanum Srinivas (DIMS)
Folsom
Fix Released
Low
melanie witt

Bug Description

When nova compute throws an exception while trying to create a vm instance, information about the exception is put into the "instance_faults" database table. That table has a message column. That column is getting filled in with the exception class name and not with the exception message.

Here is a little more detail of what I am trying to do:

I want to have my application that is using OpenStack to be able to show the root cause of why OpenStack could not create a vm. I do a "nova boot ..." call to create a vm instance. If that fails to get created properly I want to display the reason back to the user. I was expecting that I would be able to get a message with the cause when I did a "nova show vm-name" call. That call contains fault information. Without this bug fix I get information like this:
| fault | {u'message': u'RemoteError', u'code': 500, u'created': u'2012-05-11T20:19:41Z'}

The 'RemoteError' is the class name of the exception that was thrown.

Instead I would like to get an error line like this:
| fault | {u'message': u'Zero floating ips available.', u'code': 500, u'created': u'2012-05-11T20:19:41Z'}

The "Zero floating ips available" is the message that the RemoteError exception contains.

The instance_faults table has a code, message, and details columns (along with some others). For the case I have they get filled in like this:
message: RemoteError
code: 500
details: RemoteError: Zero floating ips available followed by the full stack trace

I don't want to have to parse out the message from the stack trace, so the details field will not help me. I am hoping that OpenStack can change the message field in the database to be one of two things:
1. the exception message only. For example: "Zero floating ips available"
2 the class name followed by the exception message. For example: "RemoteError: Zero floating ips available"

With one of those changes I will be able to get the error message that explains why the vm was not created with the REST call that does the equivalent of the "nova show vm-name" command and show the message to the user so they will know what went wrong.

I have attached a patch file that shows the change in the nova/compute/manager.py file for option 1

Revision history for this message
Bill Darbie (bill-darbie) wrote :
Revision history for this message
Mark McLoughlin (markmc) wrote :

This looks like a nice patch Bill, thanks!

Can you submit it via gerrit?

http://wiki.openstack.org/GerritWorkflow

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Bill Darbie (bill-darbie)
summary: - vm instance creation exception messages are not put in the message
- column of the instance_faults table
+ Include error message in instance faults
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/15200

Changed in nova:
assignee: Bill Darbie (bill-darbie) → Davanum Srinivas (dims-v)
status: Confirmed → In Progress
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Per code review, we'll need Bill's CLA to accept the patch

Changed in nova:
assignee: Davanum Srinivas (dims-v) → nobody
status: In Progress → New
Revision history for this message
Bill Darbie (bill-darbie) wrote :

I have a CLA that I signed back in September. What do I need to do exactly?

Revision history for this message
Russell Bryant (russellb) wrote :

Bill: I didn't see your name on the Contributors wiki page on wiki.openstack.org. That's what we generally use to check to see if someone has a CLA. Can you see if you can get that page updated with a link that validates your CLA? Sorry for the trouble.

Changed in nova:
status: New → Incomplete
Changed in nova:
assignee: nobody → Davanum Srinivas (dims-v)
status: Incomplete → In Progress
Changed in nova:
status: In Progress → Incomplete
Changed in nova:
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/15200
Committed: http://github.com/openstack/nova/commit/ce41618c9c24a866ccac19461653eba3b8e6dca4
Submitter: Jenkins
Branch: master

commit ce41618c9c24a866ccac19461653eba3b8e6dca4
Author: Davanum Srinivas <email address hidden>
Date: Thu Nov 1 09:53:00 2012 -0400

    Fix to include error message in instance faults

    port the patch in 1013350 from Bill Darbie (bill-darbie) into latest code base.

    incorporate one little comment from Russell about not specifying the default value twice

    added a test case

    Fixes bug 1013350

    Change-Id: Id61f10bf2502fa57d2d26199ba9608e4566e8624

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/19264

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/19264
Committed: http://github.com/openstack/nova/commit/6241f91d153c23e0ffdccd2ff623cdb4b16538a6
Submitter: Jenkins
Branch: stable/folsom

commit 6241f91d153c23e0ffdccd2ff623cdb4b16538a6
Author: Davanum Srinivas <email address hidden>
Date: Thu Nov 1 09:53:00 2012 -0400

    Fix to include error message in instance faults

    port the patch in 1013350 from Bill Darbie (bill-darbie) into latest code base.

    incorporate one little comment from Russell about not specifying the default value twice

    added a test case

    Fixes bug 1013350

    Change-Id: Id61f10bf2502fa57d2d26199ba9608e4566e8624
    (cherry picked from commit ce41618c9c24a866ccac19461653eba3b8e6dca4)

Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
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.