DynamoDB S3 import failed — invalid format

TL;DR — ImportTable finished with status FAILED, FailureCode: ItemValidationError, and the message "Some of the items failed validation checks and were not imported." The source objects don't match the InputFormat/InputCompressionType you declared, or the items are missing the primary key. Fix the format/compression to match the objects, confirm every item carries the key, and re-run the import.

What it means

"FailureCode": "ItemValidationError",
"FailureMessage": "Some of the items failed validation checks and were not
imported. Please check CloudWatch error logs for more details."

# In /aws-dynamodb/imports CloudWatch logs:
"One or more parameter values were invalid: Missing the key pk in the item"

DynamoDB Import from S3 validates each object against the format and compression you declared in the ImportTable call — the InputFormat (DYNAMODB_JSON, DYNAMODB_ION, or CSV) and InputCompressionType (GZIP, ZSTD, or NONE) take precedence over the file extension. If the bytes don't parse as declared, or an item lacks the table's primary key, that item is skipped and the job ends FAILED.

Why it happens

  • Format mismatch — you specified DYNAMODB_JSON but the objects are actually CSV (or plain JSON), so nothing parses.
  • Compression mismatch — objects under the prefix are compressed differently (some GZIP, some NONE); they must all use the same one.
  • Unsupported compression — only GZIP, ZSTD, or NONE are allowed; other codecs fail.
  • Missing primary key — a CSV/JSON item has no column/attribute matching the declared partition (or sort) key: "Missing the key pk in the item."
  • Key type mismatch — the imported key's type doesn't match the table's AttributeDefinitions (e.g. a numeric key imported as a string).
  • A 0-byte "folder" object created by the console under the prefix, which can't be parsed.

How to fix it

  1. Make InputFormat match the actual bytes — CSV files → CSV, DynamoDB JSON → DYNAMODB_JSON, Amazon Ion → DYNAMODB_ION.
  2. Make every object under the prefix use the same compression, and set InputCompressionType to match (GZIP/ZSTD/NONE).
  3. Ensure each item has the primary key — for CSV, include the key column (and header) with a name matching the declared KeySchema.
  4. Match key attribute types to the table's AttributeDefinitions (S/N/B).
  5. Read the CloudWatch error logs at /aws-dynamodb/imports, log stream <import-id>/error, for the exact per-item reason.
  6. Remove stray 0-byte folder objects; upload data via CLI/SDK rather than creating folders in the console.

Building the import file from existing data? The DynoTable desktop app exports and previews DynamoDB JSON so you can verify the format and that the primary key is present before you push objects to S3.

Lavora con DynamoDB senza la Console

DynoTable è un client desktop veloce per DynamoDB — sfoglia le tabelle, esegui query in stile SQL e modifica gli Item localmente.