• Key Management Service

kms
  1. Help Center
  2. Key Management Service
  3. API Reference
  4. Appendix
  5. Error Code

Error Code

Introduction

A customized message is returned when errors, such as 400 or 500 errors, occur in an extended public cloud API. This section describes error codes and their meanings.

Response Format

  • HTTP status code
    500
  • Response example
    {
        "error": {
            "error_code": "KMS.0101",
            "error_msg": "kms error."
        }
    }

Error Code Description

Module

Error Code

Description

Common

KMS.0101

KMS error.

KMS.0102

Abnormal KMS I/O.

KMS.0201

Invalid request URL.

KMS.0202

The JSON format of the request message is invalid.

KMS.0203

The request message length has exceeded the upper limit.

KMS.0204

The request message lacks required parameters.

KMS.0205

Invalid key_id.

KMS.0206

Invalid sequence.

KMS.0207

The key does not exist.

KMS.0208

Invalid encryption_context.

KMS.0209

The key has been disabled and cannot be used.

KMS.0210

The key is in the Pending deletion status and cannot be used.

KMS.0211

Default Master Keys does not support this operation.

KMS.0301

The value of X-Auth-Token is null or invalid.

KMS.0302

Invalid X-Auth-Token.

KMS.0303

X-Auth-Token has expired.

KMS.0305

Invalid X-Auth-Token Project Name.

KMS.0306

The user has no permission to access the key.

KMS.0307

The user role has no permission to access the API.

KMS.0308

Invalid XXX.

KMS.0309

The key must be an imported one.

KMS.0310

The key is not in the Pending import status.

KMS.0401

The tag list cannot be empty.

KMS.0402

Invalid value for the value field in the match parameter.

KMS.0403

Invalid value for the key field in the match parameter.

KMS.0404

Invalid value for the action field.

KMS.0405

Invalid value of the value field in the tag parameter.

KMS.0406

Invalid value for the key field in the tag parameter.

KMS.0407

Invalid tag list length.

KMS.0408

Invalid value for the resourceType field.

KMS.0409

The total number of tags has exceeded the upper limit.

KMS.0410

Invalid length of the value field in the tag parameter.

KMS.0411

Invalid length of the key field in the tag parameter.

KMS.0412

Invalid length of the key list in the tag parameter.

KMS.0413

Invalid length of the value list in the tag parameter has exceeded the upper limit.

KMS.0417

The value of offset must be greater than or equal to 0.

KMS.0418

offset is not required.

Creating a CMK

KMS.1101

Invalid key_alias.

KMS.1102

Invalid realm.

KMS.1103

Invalid key_description.

KMS.1104

Existing CMK alias.

KMS.1105

The number of keys has reached the upper limit.

Enabling a CMK

KMS.1201

The key is not disabled.

Disabling a CMK

KMS.1301

The key is not enabled.

Scheduling the deletion of a CMK

KMS.1401

The deletion of CMKs can be scheduled by 7 to 1096 days in advance.

KMS.1402

The key is in the Pending deletion status.

Canceling the scheduled deletion of a CMK

KMS.1501

The key is not in the Pending deletion status.

Querying the list of CMKs

KMS.1601

The value of limit falls beyond the range.

KMS.1602

The value of marker must be greater than or equal to 0.

Creating a random number

KMS.1801

random_data_length must contain 512 bits.

Creating a DEK

KMS.1901

datakey_length must contain 512 bits.

Creating a plaintext-free DEK

KMS.2001

datakey_length must contain 512 bits.

Encrypting a DEK

KMS.2101

Invalid plain_text.

KMS.2102

datakey_plain_length must contain 64 bytes.

KMS.2103

Hash verification of the data encryption key failed.

Decrypting a DEK

KMS.2201

Invalid cipher_text.

KMS.2202

datakey_cipher_length must contain 64 bytes.

KMS.2203

Hash verification of the data encryption key failed.

Changing the alias of a CMK

KMS.1101

Invalid key_alias.

KMS.1104

Existing CMK alias.

Changing the description of a CMK

KMS.1103

Invalid key_description.

Creating a grant

KMS.2401

create-grant cannot be the only granted operation permission.

KMS.2402

Invalid principal for creating/retiring a grant.

KMS.2403

Failed to create a grant.

KMS.2404

No more permissions can be granted for the CMK.

KMS.2405

You cannot grant any more permissions to the principal.

Querying grants on a CMK

KMS.1601

The value of limit falls beyond the range.

KMS.1602

The value of marker must be greater than or equal to 0.

Querying grants that can be retired

KMS.1601

The value of limit falls beyond the range.

KMS.1602

The value of marker must be greater than or equal to 0.

Revoking a grant

KMS.2501

The grant does not exist.

KMS.2502

The grant_id value does not match the key_id value.

Retiring a grant

KMS.2501

The grant does not exist.

KMS.2502

The grant_id value does not match the key_id value.

Importing CMK material

KMS.2601

Invalid token.

KMS.2602

The expiration time of an imported key must be later than the current time.

KMS.2603

The key_id does not match the key_id value in the token.

KMS.2604

The length of the external key in plaintext must be 32 bits.

KMS.2605

Token verification failed.

KMS.2606

When you re-import the material of a deleted CMK, the external key in plaintext must be consistent with that imported earlier.

Deleting CMK material

KMS.2701

CMK material can be deleted only when the CMK is in Enabled or Disabled status.