-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
Hi,
I am observing an error software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model.DynamoDbItemEncryptorException: Configuration mismatch partition or sort key does not exist in item.
during reading from a global secondary index. The query
operation returns successfully, but during reading the returned response the above mentioned error occurs.
Here is everything that i verified:
- Table config includes
plaintextOverride(PlaintextOverride.FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ)
- Table description looks accurate
{
"Table": {
"AttributeDefinitions": [
{
"AttributeName": "pk",
"AttributeType": "S"
},
{
"AttributeName": "sk",
"AttributeType": "S"
},
{
"AttributeName": "gsi1_sk",
"AttributeType": "S"
},
{
"AttributeName": "gsi2_sk",
"AttributeType": "S"
}
],
"TableName": "pii-details",
"KeySchema": [
{
"AttributeName": "pk",
"KeyType": "HASH"
},
{
"AttributeName": "sk",
"KeyType": "RANGE"
}
],
"TableStatus": "ACTIVE",
"CreationDateTime": "2023-09-07T14:48:44.776000-04:00",
"ProvisionedThroughput": {
"LastIncreaseDateTime": "1969-12-31T19:00:00-05:00",
"LastDecreaseDateTime": "1969-12-31T19:00:00-05:00",
"NumberOfDecreasesToday": 0,
"ReadCapacityUnits": 0,
"WriteCapacityUnits": 0
},
"TableSizeBytes": 4524,
"ItemCount": 4,
"TableArn": "arn:aws:dynamodb:us-west-2:000000000000:table/pii-details",
"TableId": "958b7ee0-df96-419d-a378-83fc8e70fca1",
"BillingModeSummary": {
"BillingMode": "PAY_PER_REQUEST",
"LastUpdateToPayPerRequestDateTime": "2023-09-07T14:48:44.776000-04:00"
},
"GlobalSecondaryIndexes": [
{
"IndexName": "gsi1",
"KeySchema": [
{
"AttributeName": "pk",
"KeyType": "HASH"
},
{
"AttributeName": "gsi1_sk",
"KeyType": "RANGE"
}
],
"Projection": {
"ProjectionType": "INCLUDE",
"NonKeyAttributes": [
"identityId",
"createdAt",
"nickName"
]
},
"IndexStatus": "ACTIVE",
"ProvisionedThroughput": {
"ReadCapacityUnits": 0,
"WriteCapacityUnits": 0
},
"IndexSizeBytes": 4524,
"ItemCount": 4,
"IndexArn": "arn:aws:dynamodb:ddblocal:000000000000:table/pii-details/index/gsi1"
},
{
"IndexName": "gsi2",
"KeySchema": [
{
"AttributeName": "pk",
"KeyType": "HASH"
},
{
"AttributeName": "gsi2_sk",
"KeyType": "RANGE"
}
],
"Projection": {
"ProjectionType": "INCLUDE",
"NonKeyAttributes": [
"identityId",
"createdAt",
"nickName"
]
},
"IndexStatus": "ACTIVE",
"ProvisionedThroughput": {
"ReadCapacityUnits": 0,
"WriteCapacityUnits": 0
},
"IndexSizeBytes": 4524,
"ItemCount": 4,
"IndexArn": "arn:aws:dynamodb:ddblocal:000000000000:table/pii-details/index/gsi2"
}
],
"Replicas": []
}
}
- Items are correctly populated in the index, snippet below
"Items": [
{
"sk": {
"S": "LATEST#1ff1b931-4a24-46ec-97ec-5ccd54f8ef2a"
},
"createdAt": {
"S": "2023-09-07T18:51:13.634084084Z"
},
"pk": {
"S": "<tenantId>"
},
"gsi1_sk": {
"S": "LATEST#BENEFICIARY"
},
"identityId": {
"S": "1ff1b931-4a24-46ec-97ec-5ccd54f8ef2a"
},
"nickName": {
"S": "nickName"
}
},
- Using
2.20.86
version of AWS SDK (more context@DynamoDbSecondaryPartitionKey
and@DynamoDbSecondarySortKey
annotations have no effect ontable.createTable()
aws-sdk-java-v2#3923 (comment)) - All the setters for the attributes are public
- Also read this class where the error is thrown, but i am not sure what is the correct approach here.
Can you help me with some direction? Also it would be worth adding some examples for Query
and Scan
operations for this new encryption client. TIA :)
Metadata
Metadata
Assignees
Labels
No labels