Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

acoghlan's avatar

DynamoDB as cache or session store

Trying to use DynamoDB as the session store. At the point where Laravel is calling out to DynamoDB to retrieve the record, I'm getting this error.

Error executing "GetItem" on "https://dynamodb.ap-southeast-2.amazonaws.com"; AWS HTTP error: Client error: `POST https://dynamodb.ap-southeast-2.amazonaws.com` resulted in a `400 Bad Request` response: {"__type":"com.amazon.coral.validate#ValidationException","message":"The provided key element does not match the schema" (truncated...) ValidationException (client): The provided key element does not match the schema - {"__type":"com.amazon.coral.validate#ValidationException","message":"The provided key element does not match the schema"}

Any help appreciated

0 likes
1 reply
acoghlan's avatar

OK - so I have found the answer.

The problem is that the documentation on the AWS website indicates that the key field on the DynamoDB table should be called "id" for session handling.

As Laravel 5.8 uses the DynamoDB Cache Store for storing session data, the primary key on the table needs to be named "key" not "id".

1 like

Please or to participate in this conversation.