Errors

Reference for the REST API error format, the status codes and error codes that it returns, rate limiting, and which errors you can safely retry.

When a request fails, the API returns an HTTP error status and a JSON body that describes the error. This reference lists the format, the codes, and how to handle them.

Error format

A validation error
{
  "code": "VALIDATION_FAILED",
  "message": "2 fields failed validation: name, sizeGb",
  "field": "name",
  "details": {
    "errors": [
      { "field": "name", "code": "string_too_short", "message": "String should have at least 1 character" },
      { "field": "sizeGb", "code": "missing", "message": "Field required" }
    ]
  }
}
FieldPresentMeaning
codeAlwaysA machine-readable error code from the tables below. Branch on this field.
messageAlwaysA description in English for people. Don't parse it; use code in your program.
fieldWhen the error is about one request fieldThe name of that field, such as name or Idempotency-Key.
detailsWhen there is more contextStructured data that depends on the code, for example the list of resources that block a delete.
retryableOnly when its value is trueSending the identical request again can succeed. When the field is missing, it's false.

The API doesn't use 400 Bad Request: a request that doesn't match the operation's schema returns 422 Unprocessable Entity.

Status codes and error codes

StatusCodeMeaningWhat to do
400IDEMPOTENCY_KEY_REQUIREDA POST request that creates a resource, sent with an API token or a service account key, has no Idempotency-Key header.Send the header with a new UUID, and the same UUID when you retry. See Idempotent requests.
401UNAUTHENTICATEDThe credential is missing, wrong, expired, or revoked.Check the Authorization header. See Authenticate with API tokens.
403FORBIDDENYou aren't allowed to do this. details.reason, when present, says why.See Troubleshooting.
403MFA_STEP_UP_REQUIREDThe operation needs a recent two-factor verification in your console session.Verify with your authenticator app in the console, and try again.
403MFA_SETUP_REQUIREDThe operation needs two-factor authentication, and your account has none.Set up two-factor authentication.
403INTERACTIVE_SESSION_REQUIREDThe operation can't be done with an API token or a service account key.Do it in the console.
404NOT_FOUNDThe resource doesn't exist, or you can't access it. The API doesn't tell these two cases apart.Check the ID and the project.
405METHOD_NOT_ALLOWEDThe path exists, but not with this method.Check the method in the API reference.
409CONFLICTThe request conflicts with the current state, for example a name that's taken or an action that's already running.Read the resource, and resolve the conflict. If retryable is true, retry later.
409QUOTA_EXCEEDEDThe request would exceed a quota of your subscription, or a product limit such as the number of keys of a service account. For a subscription quota, the message names the resource, its limit and usage, and the quota ID.Free up resources. For a subscription quota, you can also request an increase. See Quotas.
409CAPACITY_UNAVAILABLEThe region can't place the request right now.Retry later, or choose another size. This error is retryable.
409DEPENDENCY_BLOCKEDOther resources depend on this one. details lists them, for example the instance that a volume is attached to.Remove the dependencies first.
409LOCKEDThe resource can't be changed, for example a built-in role.None; the resource stays as it is.
409DELETION_PROTECTEDDeletion protection is on.Turn deletion protection off, and delete again.
409ROOT_VOLUME_WOULD_BE_DELETED, ATTACHED_VOLUME_WOULD_BE_DELETEDDeleting the instance would also delete a volume that must be kept, so the platform refused the delete.See Troubleshoot virtual machines.
412PRECONDITION_FAILEDThe If-Match value doesn't match the resource's current version, or a required If-Match header is missing.Read the resource again, and repeat the change with its new ETag.
422VALIDATION_FAILEDThe request isn't valid. field and details.errors name the problems.Fix the request. See Validation errors.
429RATE_LIMITEDYou sent too many requests.Wait for the number of seconds in the Retry-After header. See Rate limiting.
500INTERNALAn unexpected error occurred.Retry later. If it persists, report it with the X-Request-Id.
502PROVIDER_ERRORThe cloud accepted the work, and it failed there, for example an image that can't boot. The error isn't marked retryable.Read the message, and change the request.
502INTERNAL with "retryable": trueThe API gateway couldn't reach a service.Retry with backoff.
503PROVIDER_UNAVAILABLEA cloud service is temporarily unreachable.Retry with backoff. This error is retryable.

Some requests also return 404 Not Found for a feature that the region doesn't offer, for example when you request encryption at rest where the region can't provide it. The message names the feature and the region. Retrying can't change this answer.

Imported projects

These codes appear only for projects that the platform operator imported for you, with their existing resources:

StatusCodeMeaning
409IMPORTED_PROJECT_ACK_REQUIREDDeleting the project deletes the resources that came with the import. The request must set acknowledgeImportedProjectDestruction to true to confirm it.
403IMPORTED_PROJECT_PROTECTEDFor a period after the import, you can't delete the project. details.protectedUntil says until when.
409IMPORTED_PROJECT_IMPORT_INCOMPLETEThe import isn't finished, so the project can't be deleted.
409IMPORTED_PROJECT_RELEASE_IN_PROGRESSThe operator is releasing the project, or a release failed.
409IMPORTED_BACKUP_PLAN_READ_ONLYThe backup plan holds the backups that came with the import. You can read it and restore from it, but you can't change it.

Validation errors

A 422 Unprocessable Entity response for an invalid request lists every problem at once in details.errors. Each entry has:

  • field: the field's path in the request, with dots between levels, or null when the problem concerns the body as a whole.
  • code: the kind of problem, such as missing or string_too_short.
  • message: a description in English.

The top-level field describes the first entry, and message names every field. Fix all the listed fields before you send the request again.

Rate limiting

The API gateway limits how fast each credential can send requests. Every API token, service account key, and console session has its own limit, and requests without a credential are limited by source IP address. The limit allows short bursts above the sustained rate.

For an API token or a service account key, the limit applies per credential and also per tenant, over all of the tenant's credentials together. Every response to such a request carries these headers:

HeaderValue
X-RateLimit-LimitThe number of requests that the current window allows.
X-RateLimit-RemainingThe number of requests left in the current window.
X-RateLimit-ResetThe number of seconds until the window resets, at least 1.

When you exceed the limit, the gateway answers 429 Too Many Requests with the code RATE_LIMITED, "retryable": true, and a Retry-After header with the number of seconds to wait, at least 1. Wait at least that long before you send the next request.

This limit applies to requests to the REST API. For the limits of application credentials, see OpenStack API limits.

Errors in asynchronous operations

When the work of a 202 Accepted request fails, the operation's state becomes FAILED, and its error field contains an error in the format above. An operation that succeeded can carry a warning in the same format, when something that you requested couldn't be delivered. See Synchronous and asynchronous requests.

Responses from the network in front of the API

During a deployment, a proxy in front of the API can answer 500, 502, 503, or 504 with a body that isn't in the error format above, such as plain text. Such a response means that your request didn't reach the API. Retry it with backoff and the same Idempotency-Key.

Retry errors

  • Retry when the response has "retryable": true, and after a 500, 502, 503, or 504 response that isn't in the error format. Send the same Idempotency-Key again. See Idempotent requests.
  • Wait longer before each retry, for example 1, 2, 4, and then 8 seconds. After a 429 response, wait at least the Retry-After time.
  • Don't retry other 4xx errors unchanged. Fix the request, the credential, or the state of the resource first.

On this page