You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocation #8728
For contributors, human or agent. Comment here to claim this issue and wait for the assignment before opening a PR; if two PRs show up, the assignee's stays. AI-assisted work is welcome, say so in the PR and tell us how you verified it: run the tests yourself and paste what you saw, do not describe runs you did not do. Read AGENTS.md first, it has the commands and the rules the CI enforces. This goes into 3.41.0.
Expected Behaviour
POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty string or to a value that is not a recognised boolean is treated as "not disabled", possibly with a warning. Only truthy values disable idempotency.
Current Behaviour
Both idempotent and idempotent_function call strtobool(os.getenv("POWERTOOLS_IDEMPOTENCY_DISABLED", "false")), and strtobool("") raises ValueError: invalid truth value '', so every invocation crashes before the handler runs. "0", "no" and "False" work. An empty value is easy to end up with in IaC templates and CI variables.
Code snippet
importosos.environ["POWERTOOLS_IDEMPOTENCY_DISABLED"] =""@idempotent_function(data_keyword_argument="order", persistence_store=layer)defprocess(order):
return"ok"process(order={"id": 1}) # ValueError: invalid truth value ''
Possible Solution
In aws_lambda_powertools/utilities/idempotency/idempotency.py, resolve the variable once with a helper that returns False for empty or unparsable values (and logs a debug message), and use it in both decorators. Check whether resolve_truthy_env_var_choice in aws_lambda_powertools/shared/functions.py already fits. Tests: "", "maybe" and unset all run the function; "true" skips idempotency.
Item 11 of the Idempotency audit in #8603. No AWS resources needed.
For those interested in contributing, please leave a comment below so that we can assign the issue to you and make sure we don't duplicate efforts. If you have any further questions, please don't hesitate to ask below or on our Discord server.
Hi! I'd like to work on this one. My plan is to resolve POWERTOOLS_IDEMPOTENCY_DISABLED once with a helper that treats empty or unparsable values as "not disabled" (with a debug log), use it in both idempotent and idempotent_function, and add functional tests for "", "maybe", unset and "true". I'll wait for assignment before opening a PR.
@lechakrawarthy you asked first, it's yours. @bfs2021 thanks for following the claim-first flow, this one was already taken; the Logger audit in #8730 will turn into issues this week, keep an eye on it.
Activity
powertools-for-aws-oss-automation commentedon Oct 31, 2026
Note
For those interested in contributing, please leave a comment below so that we can assign the issue to you and make sure we don't duplicate efforts. If you have any further questions, please don't hesitate to ask below or on our Discord server.
lechakrawarthy commentedon Oct 31, 2026
Hi! I'd like to work on this one. My plan is to resolve
POWERTOOLS_IDEMPOTENCY_DISABLEDonce with a helper that treats empty or unparsable values as "not disabled" (with a debug log), use it in bothidempotentandidempotent_function, and add functional tests for"","maybe", unset and"true". I'll wait for assignment before opening a PR.bfs2021 commentedon Nov 1, 2026
Claiming this one — will follow AGENTS.md (claim-first flow), verify with the test commands there, and open a PR once assigned.
leandrodamascena commentedon Nov 1, 2026
@lechakrawarthy you asked first, it's yours. @bfs2021 thanks for following the claim-first flow, this one was already taken; the Logger audit in #8730 will turn into issues this week, keep an eye on it.