Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: dynamodb batch write item returns 500 if missing primary key and sort key from item(s) #6290

Open
1 task done
amwill04 opened this issue Jun 17, 2022 · 1 comment
Open
1 task done
Labels
aws:dynamodb good first issue status: triage needed type: bug

Comments

@amwill04
Copy link

@amwill04 amwill04 commented Jun 17, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running batch-write-item and request-items is missing the primary key and/or the sort key for a given table it returns 500 meaning that any sdk will try again before exhausting retries and hiding the true ValidationException error.

Expected Behavior

Return ValidationException error

How are you starting LocalStack?

With a docker run command

Steps To Reproduce

docker run -d --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack

aws --endpoint-url=http://localhost:4566 dynamodb create-table \
    --table-name temp-table \
    --attribute-definitions AttributeName=id,AttributeType=S AttributeName=sortKey,AttributeType=S \
    --key-schema AttributeName=id,KeyType=HASH AttributeName=sortKey,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5

aws --endpoint-url=http://localhost:4566 dynamodb list-tables


aws --endpoint-url=http://localhost:4566 dynamodb   batch-write-item \
    --request-items '{"temp-table":[{"PutRequest":{"Item":{"anotherKey":{"S":"missing primary key and sort key"}}}}]}'

Environment

- OS: macos
- LocalStack: latest

Anything else?

Run this against AWS and correct error will return with no retries

@amwill04 amwill04 added status: triage needed type: bug labels Jun 17, 2022
@github-actions
Copy link

@github-actions github-actions bot commented Jun 17, 2022

Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our developer guide.

@silv-io silv-io added aws:dynamodb good first issue labels Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:dynamodb good first issue status: triage needed type: bug
Projects
None yet
Development

No branches or pull requests

2 participants