[BUG] ValidationException: The provided key element does not match the schema
See original GitHub issueSummary:
Model.get throw the error below when it gets an item from the table with string partition key.
Code sample:
var dynamoose = require('dynamoose');
const User = dynamoose.model("User", {"id": String, "name": String});
try {
const myUser = await User.get('1');
console.log(myUser);
} catch (error) {
console.error(error);
}
Schema
{"id": String, "name": String}
Model
// Code here
General
// Code here
Current output and behavior (including stack trace):
Expected output and behavior:
Getting the document without an error
Environment:
Operating System: masOS Big Sur
Operating System Version: 11.4
Node.js version (node -v
): 16.13.1
NPM version: (npm -v
): 8.1.2
Dynamoose version: 2.8.5
Other information (if applicable):
Other:
- I have read through the Dynamoose documentation before posting this issue
- I have searched through the GitHub issues (including closed issues) and pull requests to ensure this issue has not already been raised before
- I have searched the internet and Stack Overflow to ensure this issue hasn’t been raised or answered before
- I have tested the code provided and am confident it doesn’t work as intended
- I have filled out all fields above
- I am running the latest version of Dynamoose
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ValidationException: The provided key element does not ...
DocumentClient() I kept getting "ValidationException: The provided key element does not match the schema" without it telling me what was wrong.
Read more >[Solved] DynamoDB Key element does not match the schema
When performing a put or update operation, it is likely that you are trying to insert a record which does not have all...
Read more >The Provided Key Element Does Not Match the Schema Error
The provided key element does not match the schema error occurs due to only half of the primary key provided for an item...
Read more >DynamoDB The provided key element does not ... - Edureka
user = users.get_item(email='john.doe@gmail.com'). I get the following error : 'The provided key element does not match the schema'.
Read more >Resolve error "The provided key element does not match the ...
Resolution. This error usually happens when you have an incorrect schema, corrupt data, or mismatched data. If you still get the error message ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@donghoon-song Sorry. Have to close this issue. You haven’t provided enough information for us to reproduce. As @andrewda said, this error is coming from AWS, not Dynamoose. My guess is the key doesn’t match what you have setup in AWS. But as I said, you haven’t provided enough information for us to be able to reproduce.
The returned request is the same as you described. But it still throws the error in the screenshot. Thank you ☺️