2014-12-17 10:14:37 -06:00
|
|
|
|
======
|
|
|
|
|
Faults
|
|
|
|
|
======
|
|
|
|
|
|
2016-02-15 14:42:02 +00:00
|
|
|
|
This doc explains how to understand what has happened to your API request.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Every HTTP request has a status code. 2xx codes signify the API was a success.
|
|
|
|
|
However, that is often not the end of the story. That generally only means the
|
2016-02-15 14:42:02 +00:00
|
|
|
|
request to start the operation has been accepted. It does not mean the action
|
2015-11-09 12:25:23 +00:00
|
|
|
|
you requested has successfully completed.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Tracking Errors by Request ID
|
2016-02-15 14:42:02 +00:00
|
|
|
|
=============================
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Every request made has a unique Request ID.
|
|
|
|
|
This is returned in a response header.
|
|
|
|
|
Here is an example response header:
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
X-Compute-Request-ID: req-4b9e5c04-c40f-4b4f-960e-6ac0858dca6c
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Server Actions
|
|
|
|
|
--------------
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
There is an API for end users to list the outcome of Server Actions,
|
|
|
|
|
referencing the requested action by request id.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
For more details, please see:
|
|
|
|
|
http://developer.openstack.org/api-ref-compute-v2.1.html#os-instance-actions-v2.1
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Logs
|
|
|
|
|
----
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
All logs on the system, by default, include the request-id when available.
|
|
|
|
|
This allows an administrator to track the API request processing as it
|
|
|
|
|
transitions between all the different nova services.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Instance Faults
|
|
|
|
|
---------------
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Nova often adds an instance fault DB entry for an exception that happens
|
2015-12-08 05:34:26 +00:00
|
|
|
|
while processing an API request. This often includes more administrator
|
|
|
|
|
focused information, such as a stack trace.
|
2015-11-09 12:25:23 +00:00
|
|
|
|
However, there is currently no API to retrieve this information.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Notifications
|
|
|
|
|
-------------
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
In many cases there are also notifications emitted that describe the error.
|
|
|
|
|
This is an administrator focused API, that works best when treated as
|
|
|
|
|
structured logging.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
Synchronous Faults
|
|
|
|
|
==================
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
If an error occurs while processing our API request, you get a non 2xx
|
|
|
|
|
API status code. The system also returns additional
|
|
|
|
|
information about the fault in the body of the response.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
**Example: Fault: JSON response**
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
|
|
|
|
.. code::
|
|
|
|
|
|
|
|
|
|
{
|
2015-11-22 22:32:01 +08:00
|
|
|
|
"itemNotFound":{
|
|
|
|
|
"code": 404,
|
|
|
|
|
"message":"Aggregate agg_h1 could not be found."
|
2014-12-17 10:14:37 -06:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-15 14:42:02 +00:00
|
|
|
|
The error ``code`` is returned in the body of the response for convenience.
|
|
|
|
|
The ``message`` section returns a human-readable message that is appropriate
|
|
|
|
|
for display to the end user. The ``details`` section is optional and may
|
2015-11-09 12:25:23 +00:00
|
|
|
|
contain information—for example, a stack trace—to assist in tracking
|
2016-02-15 14:42:02 +00:00
|
|
|
|
down an error. The ``details`` section might or might not be appropriate for
|
2015-11-09 12:25:23 +00:00
|
|
|
|
display to an end user.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
The root element of the fault (such as, computeFault) might change
|
2016-02-15 14:42:02 +00:00
|
|
|
|
depending on the type of error. The following link contains a list of possible
|
2015-11-09 12:25:23 +00:00
|
|
|
|
elements along with their associated error codes.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-09 12:25:23 +00:00
|
|
|
|
For more information on possible error code, please see:
|
|
|
|
|
http://specs.openstack.org/openstack/api-wg/guidelines/http.html#http-response-codes
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
|
|
|
|
Asynchronous faults
|
2015-11-09 12:25:23 +00:00
|
|
|
|
===================
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
2015-11-26 21:23:18 +08:00
|
|
|
|
An error may occur in the background while a server is being built or while a
|
|
|
|
|
server is executing an action.
|
2015-11-09 12:25:23 +00:00
|
|
|
|
|
2015-11-26 21:23:18 +08:00
|
|
|
|
In these cases, the server is usually placed in an ``ERROR`` state. For some
|
|
|
|
|
operations, like resize, its possible that the operations fails but
|
2015-11-09 12:25:23 +00:00
|
|
|
|
the instance gracefully returned to its original state before attempting the
|
|
|
|
|
operation. In both of these cases, you should be able to find out more from
|
|
|
|
|
the Server Actions API described above.
|
|
|
|
|
|
2015-11-26 21:23:18 +08:00
|
|
|
|
When a server is placed into an ``ERROR`` state, a fault is embedded in the
|
|
|
|
|
offending server. Note that these asynchronous faults follow the same format
|
|
|
|
|
as the synchronous ones. The fault contains an error code, a human readable
|
|
|
|
|
message, and optional details about the error. Additionally, asynchronous
|
2016-02-15 14:42:02 +00:00
|
|
|
|
faults may also contain a ``created`` timestamp that specifies when the fault
|
2015-11-26 21:23:18 +08:00
|
|
|
|
occurred.
|
2014-12-17 10:14:37 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Example: Server in error state: JSON response**
|
|
|
|
|
|
|
|
|
|
.. code::
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"server": {
|
|
|
|
|
"id": "52415800-8b69-11e0-9b19-734f0000ffff",
|
|
|
|
|
"tenant_id": "1234",
|
|
|
|
|
"user_id": "5678",
|
|
|
|
|
"name": "sample-server",
|
|
|
|
|
"created": "2010-08-10T12:00:00Z",
|
|
|
|
|
"hostId": "e4d909c290d0fb1ca068ffafff22cbd0",
|
|
|
|
|
"status": "ERROR",
|
|
|
|
|
"progress": 66,
|
|
|
|
|
"image" : {
|
|
|
|
|
"id": "52415800-8b69-11e0-9b19-734f6f007777"
|
|
|
|
|
},
|
|
|
|
|
"flavor" : {
|
|
|
|
|
"id": "52415800-8b69-11e0-9b19-734f216543fd"
|
|
|
|
|
},
|
|
|
|
|
"fault" : {
|
2015-11-22 22:32:01 +08:00
|
|
|
|
"code" : 500,
|
2014-12-17 10:14:37 -06:00
|
|
|
|
"created": "2010-08-10T11:59:59Z",
|
2015-11-22 22:32:01 +08:00
|
|
|
|
"message": "No valid host was found. There are not enough hosts available.",
|
|
|
|
|
"details": [snip]
|
2014-12-17 10:14:37 -06:00
|
|
|
|
},
|
|
|
|
|
"links": [
|
|
|
|
|
{
|
|
|
|
|
"rel": "self",
|
|
|
|
|
"href": "http://servers.api.openstack.org/v2/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"rel": "bookmark",
|
|
|
|
|
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|