ValidationException: Missing the key AWS Origin: Platform & cloud Last updated 13 Oct 2026

DynamoDB ValidationException: One or more parameter values were invalid: Missing the key pk in the item / The provided key element does not match the schema

The item or key doesn’t match the table’s primary key schema — wrong attribute name, wrong type, or missing sort key.

Exact message you may see Missing the keyThe provided key element does not match the schemaOne or more parameter values were invalid
Seen on: AWS

Meaning

Every item needs the partition key (and sort key if defined) with the exact name and type (S, N, B). Using “id” when the table key is “pk”, sending a number as a string, or omitting the sort key in GetItem triggers it.

Common causes

  • Attribute name differs from the key schema
  • Wrong type (string vs number)
  • Sort key missing in GetItem/UpdateItem/DeleteItem
  • Empty string for a key attribute

⚡ Quick fix

  1. describe-table to see KeySchema and AttributeDefinitions
  2. Send both keys with matching names/types
  3. Use Query for partial-key lookups

Detailed fix by platform

AWS CLI

  1. aws dynamodb describe-table --table-name orders --query 'Table.[KeySchema,AttributeDefinitions]'

How to diagnose

  1. Schema — KeySchema names/types
  2. Request — Key object sent

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

1048 — MySQL ERROR 1048 (23000): Column 'x' cannot be null (MySQL)10481264 — MySQL ERROR 1264 (22003): Out of range value for column 'x' at row 1 (MySQL)12641366 — MySQL ERROR 1366 (HY000): Incorrect integer value: '' for column 'x' at row 1 (MySQL)13661406 — MySQL ERROR 1406: Data too long for column (MySQL)140622001 — ERROR: value too long for type character varying(255) (PostgreSQL)2200122P02 — ERROR: invalid input syntax for type integer: "abc" (PostgreSQL)22P0222P02 uuid — ERROR: invalid input syntax for type uuid: "x" (PostgreSQL)22P02 uuid23502 — ERROR: null value in column "x" of relation "y" violates not-null constraint (PostgreSQL)23502Validatio…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.