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: IdempotencyPersistenceLayerError cause undefined #2915

Closed
jorgecamilowu opened this issue Aug 12, 2024 · 4 comments · Fixed by #2916
Closed

Bug: IdempotencyPersistenceLayerError cause undefined #2915

jorgecamilowu opened this issue Aug 12, 2024 · 4 comments · Fixed by #2916
Assignees
Labels
bug Something isn't working completed This item is complete and has been merged/shipped idempotency This item relates to the Idempotency Utility

Comments

@jorgecamilowu
Copy link

Expected Behavior

When looking at the logs, the cause attribute of IdempotencyPersistenceLayerError should include what actually went wrong.

Discord discussion link

Current Behavior

The cause attribute of IdempotencyPersistenceLayerError is undefined

Code snippet

const persistenceStore = new DynamoDBPersistenceLayer({
  tableName: "Token.1234",
});

export const handler = makeIdempotent(handlerFunction, {
  persistenceStore,
});

Steps to Reproduce

  1. Pass an invalid table name to DynamoDBPersistenceLayer such as "Token.1234"
  2. Trigger the lambda
  3. See IdempotencyPersistenceLayerError error in Cloudwatch logs missing the cause attribute
    image

Possible Solution

No response

Powertools for AWS Lambda (TypeScript) version

2.7.0

AWS Lambda function runtime

20.x

Packaging format used

npm

Execution logs

2024-08-12T06:04:28.165Z	1ecc73f4-1b73-4bf0-bf92-d8fd26a123d6	ERROR	Invoke Error 	{
    "errorType": "IdempotencyPersistenceLayerError",
    "errorMessage": "Failed to save in progress record to idempotency store",
    "name": "IdempotencyPersistenceLayerError",
    "stack": [
        "IdempotencyPersistenceLayerError: Failed to save in progress record to idempotency store",
        "    at #saveInProgressOrReturnExistingResult (/var/task/index.js:1459894:13)",
        "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "    at async IdempotencyHandler.handle (/var/task/index.js:1459814:42)"
    ]
}
@jorgecamilowu jorgecamilowu added bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Aug 12, 2024
Copy link

boring-cyborg bot commented Aug 12, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@dreamorosi dreamorosi added idempotency This item relates to the Idempotency Utility confirmed The scope is clear, ready for implementation and removed triage This item has not been triaged by a maintainer, please wait labels Aug 12, 2024
@dreamorosi dreamorosi self-assigned this Aug 12, 2024
@dreamorosi
Copy link
Contributor

Hi @jorgecamilowu, thank you for taking the time to open this issue, and for finding the bug in the first place.

I have started working on a PR that should address the issue.

Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Aug 13, 2024
Copy link
Contributor

This is now released under v2.8.0 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed This item is complete and has been merged/shipped idempotency This item relates to the Idempotency Utility
Projects
2 participants