Skip to content
Discussion options

You must be logged in to vote

It looks I found the root clause.

aws_lambda_powertools/init.py -> call set_package_logger_handler() -> call powertools_debug_is_set()
As POWERTOOLS_DEBUG=true, powertools_debug_is_set() triggers warnings.warn() which throws an Exception

The Exception is caught in awslambdaric bootstrap.py and results sys.exit(1)
https://github.com/aws/aws-lambda-python-runtime-interface-client/blob/3f43f4d089600669435038d7e1fa41145d9ff94f/awslambdaric/bootstrap.py#L506-L516

In addition, an environment PYTHONWARNINGS=error is set in AWS public.ecr.aws/lambda/python:3.13 image

To work with container as a Lambda runtime, a workaround is to capture all warnings while importing AWS PowerTools.

import logging
i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gnought
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant