DynamoDB GSI does not project the requested attribute
TL;DR — You queried a Global Secondary Index and asked (via ProjectionExpression or Select=ALL_ATTRIBUTES) for an attribute the index doesn't project. A GSI only returns its own key attributes, the base table's key attributes, and whatever you listed in its projection — nothing else. Either narrow the request to projected attributes, add the attribute to the GSI's projection, or query the base table by primary key.
What it means
ValidationException: One or more parameter values were invalid: Global secondary
index <index_name> does not project <attribute_name>
# or, with Select=ALL_ATTRIBUTES on a KEYS_ONLY / INCLUDE index:
ValidationException: Select type ALL_ATTRIBUTES is not supported for global
secondary index <index_name> because its projection type is not ALL
# what the engine actually returns, reproduced against DynamoDB Local:
ValidationException: One or more parameter values were invalid: Global secondary index gsi1 does not project [unprojected]Unlike a Local Secondary Index (which can fetch un-projected attributes from the base item at extra cost), a GSI is a self-contained copy. It physically stores only the attributes in its projection — AWS's own docs are blunt: "global secondary index queries cannot fetch attributes from the base table." Asking a GSI query for anything outside that set is unsatisfiable, so DynamoDB rejects the request (a ValidationException, HTTP 400 — not retryable) instead of silently returning partial data.
Why it happens
ProjectionType: KEYS_ONLYindex queried for a non-key attribute.ProjectionType: INCLUDEindex queried for an attribute not in theNonKeyAttributeslist.Select: ALL_ATTRIBUTESon a GSI that isn'tProjectionType: ALL.- Assuming LSI behavior — expecting a GSI to fetch un-projected attributes from the base table (only LSIs do that).
- A projection that drifted from the query's needs as the access pattern evolved.
How to fix it
- Request only projected attributes — restrict
ProjectionExpressionto the GSI's keys + its projected set, or dropSelect: ALL_ATTRIBUTES. - Add the attribute to the GSI projection — for a new attribute, create/replace the GSI with
ProjectionType: INCLUDE(listing it) orALL. Existing GSIs' projections can't be edited in place; you add a new GSI or recreate it. - Fetch from the base table — use the keys the GSI does return to do a
GetItem/BatchGetItemon the base table for the full item. - Use
ProjectionType: ALLif you routinely need every attribute from the index (accepting the extra storage/write cost).
Want to see which attributes a GSI actually carries before you query it? The DynoTable desktop app shows each index's projection so you request only what's there — no does not project surprise.
Related errors
- Index not found — the index name itself is wrong or still building.
- Query condition missed key schema element — the GSI key condition is incomplete.
- Code example: Query a GSI in Node.js — a working GSI query to compare against.
- Learn: Index projections · GSI vs LSI · Indexes overview
References
- Using Global Secondary Indexes in DynamoDB — Amazon DynamoDB Developer Guide
- Managing Global Secondary Indexes in DynamoDB — Amazon DynamoDB Developer Guide
- Query — Amazon DynamoDB API Reference
- Error handling with DynamoDB — Amazon DynamoDB Developer Guide
Last verified 2026-07-13 against the official AWS documentation linked above.