-
Notifications
You must be signed in to change notification settings - Fork 421
Feature request: improve error messaging around IdempotencyPersistenceLayerError #1772
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey @cgoettel, thanks for raising this issue. I agree we need to enrich the error message here to be more meaningful. I will start working on this in a few coming days (probably end of the week or beginning of the next one). Will update you about the progress |
Hey @cgoettel. I was able to reproduce mentioned issue and I can confirm your observation, that lambda emits logs in the shape you shared in the ticket itself. Let me share some details about it, just for future reference or interested readers :-) In idempotency feature we rely on “raise from” statement to raise an exception with extra information whenever we have problem. That works if I trigger handler code directly from my local environment (not from lambda). Then we get chained traces like in the following snippet:
Lambda runtime behaves differently though. In a runtime bootstrap action we modify logging behavior. |
hey @cgoettel, we just merged changes to the Idempotency feature, that will improve error messaging and hopefully will simplify debugging or reasoning about potential issues in future. Thank you one more time for the contribution and making Lambda Powertools better :-) |
|
This is now released under 2.6.0 version! |
Lifesaver! Thanks! Just found this thread and upgraded to the new PowerTools in order to troubleshoot. Trying an idempotent lambda in python and this was my first time using DynamoDB. Had to add the following actions to my lambda config: Don't know how I would have figured this out otherwise. Might be good to add this to the PowerTools Idempotency docs! (Unless I just missed it!) |
We somehow missed it in the docs 😳! Apologies from the team.
We always add within getting started—>required resources, with an IAM
section when needed. For Idempotency docs, we added in the sample SAM
template under Policies — however, we missed a dedicated section since we
know not everyone uses SAM
If someone wants to make their first PR, please feel free to do so and we
can help with the wording - otherwise we’ll get it done this week.
https://awslabs.github.io/aws-lambda-powertools-python/2.7.1/utilities/idempotency/#required-resources
…On Mon, 6 Feb 2023 at 00:28, Matt Webster ***@***.***> wrote:
Lifesaver! Thanks!
Just found this thread and upgraded to the new PowerTools in order to
troubleshoot. Trying an idempotent lambda in python and this was my first
time using DynamoDB.
Had to add the following actions to my lambda config:
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem"
],
Don't know how I would have figured this out otherwise. Might be good to
add this to the PowerTools Idempotency docs! (Unless I just missed it!)
—
Reply to this email directly, view it on GitHub
<#1772 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBFDYTWJ52USUML3LDLWWAZQPANCNFSM6AAAAAASZ2GYEE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
@mattyweb we've just patched the live documentation with the IAM section for Idempotency - took us slightly longer to avoid leaking new features coming in the next release. https://awslabs.github.io/aws-lambda-powertools-python/2.7.1/utilities/idempotency/#iam-permissions Thank you again for flagging this! |
Totally missed the update here. Thanks so much for the doc fix! |
Use case
I was trying to implement the basic example using Terraform to deploy the Lambda and DynamoDB. However, I had forgotten to include the policy for the Lambda to talk to DynamoDB and kept getting the following error:
Each error message is the same which isn't entirely helpful. So I dug through the code and could see that it was exception chaining, but that also wasn't particularly helpful. It wasn't until I tried to implement the basic example using AWS SAM that I was able to see the policy that I'd forgotten to attach.
Solution/User Experience
Ideally, something in the error chain would receive a bad permissions error and that information would percolate up to the user. Every other time I deploy into AWS I get clear permissions errors and the reason I didn't even consider a permissions issue is because it was always so clear previously when that was it.
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: