Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-3965

When creating a key with too long attribute values, KMS returns OK but key not really added

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • kms
    • None

    Description

      When creating a key with a too long attribute values, KMS returns OK but key not really added. Here's the curl command I used:

      Note: Unnecessary use of -X or --request, POST is already inferred.
      *   Trying 192.168.56.116...
      * TCP_NODELAY set
      * Connected to centos79 (192.168.56.116) port 9292 (#0)
      > POST /kms/v1/keys/?user.name=geasop HTTP/1.1
      > Host: centos79:9292
      > User-Agent: curl/7.61.1
      > Content-Type: application/json
      > Accept: application/json
      > Content-Length: 1298
      > Expect: 100-continue
      >
      < HTTP/1.1 100 Continue
      * We are completely uploaded and fine
      < HTTP/1.1 201 Created
      < Set-Cookie: hadoop.auth="u=geasop&p=geasop&t=simple-dt&e=1667976698923&s=1xmGwdiYcOSSNLsK9JUi62KtvsffGh8nplekjP7MEc8="; HttpOnly
      < Location: http://centos79:9292/kms/v1/keys/v1/key/ubuntu-passphrase
      < Content-Type: application/json
      < Content-Length: 116
      < Date: Tue, 08 Nov 2022 20:51:38 GMT
      < Server: Apache Ranger
      <
      {
        "material" : "8V53MUwqqEOSQ8DvEPVkXA",
        "name" : "ubuntu-passphrase",
        "versionName" : "ubuntu-passphrase@0"
      * Connection #0 to host centos79 left intact
      }[geasop@RH84 ~]  

      We can see from the PostgreSQL log there's a error:

      2022-11-08 12:51:38.970 PST [9933] ERROR:  value too long for type character varying(1024)
      2022-11-08 12:51:38.970 PST [9933] STATEMENT:  INSERT INTO ranger_keystore (ID, ADDED_BY_ID, kms_alias, kms_attributes, kms_bitLength, kms_cipher, CREATE_TIME, kms_createdDate, kms_description, kms_encoded, UPDATE_TIME, UPD_BY_ID, kms_version) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
      2022-11-08 12:51:38.972 PST [9933] ERROR:  current transaction is aborted, commands ignored until end of transaction block
      2022-11-08 12:51:38.972 PST [9933] STATEMENT:  SELECT 1
      2022-11-08 12:51:38.989 PST [10423] ERROR:  value too long for type character varying(1024)
      2022-11-08 12:51:38.989 PST [10423] STATEMENT:  INSERT INTO ranger_keystore (ID, ADDED_BY_ID, kms_alias, kms_attributes, kms_bitLength, kms_cipher, CREATE_TIME, kms_createdDate, kms_description, kms_encoded, UPDATE_TIME, UPD_BY_ID, kms_version) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
      2022-11-08 12:51:38.989 PST [10423] ERROR:  current transaction is aborted, commands ignored until end of transaction block
      2022-11-08 12:51:38.989 PST [10423] STATEMENT:  SELECT 1  

      Now when we use the API to see if the key has been created we don't see it. The KMS UI give the same result.

      Attachments

        Activity

          People

            vikkumar Vikas Kumar
            vikkumar Vikas Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: