Bug: `log_uncaught_exceptions` only works locally and not on lambda
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 52/100
- Issue 類型
- 文件
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- aws, python
研究方向
Start by locating the documentation for Logger(log_uncaught_exceptions=True) and reviewing the discussion about why the behavior differs in AWS Lambda. Reproduce the provided handler in an actual Lambda runtime and compare its output with local execution. The change is complete when the documentation clearly states which environments support this option and explains the observed unstructured output; confirm the project’s documentation build or relevant checks if available.
由索引模型根據 Issue 內容生成。
描述
Expected Behaviour
When log_uncaught_exceptions=True, uncaught exceptions in a lambda are handled and transformed to a structured log.
Current Behaviour
Uncaught exceptions are printed unstructured.
Code snippet
from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext
logger = Logger(log_uncaught_exceptions=True)
def lambda_handler(event: dict, context: LambdaContext) -> str:
raise(Exception("asdf"))
Possible Solution
Probably none. Document this behavior.
I don't think sys.excepthook can be overridden in a lambda container, but I have no proof because the original forum thread that details this has been deleted by AWS with no replacement.
Steps to Reproduce
Set log_uncaught_exceptions=True in an actual running lambda. If log_uncaught_exceptions=True on a local machine, the behavior runs just as intended.
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.9
Packaging format used
Lambda Layers
Debugging logs
No response
- 主要語言
- Python
- 星號
- 3.3k
- 分支
- 511
- 平均合併
- 3 天 8 小時
- 30 天內合併 PR
- 92
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws-powertools/powertools-lambda-python 的其他 Issue
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocation可能已有人在做 @lechakrawarthy 於 1 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 85/100
aws-powertools/powertools-lambda-python#8728 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GET可能已有人在做 @coughlmao 於 1 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 85/100
aws-powertools/powertools-lambda-python#8727 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 seconds可能已有人在做 @CJstate 於 1 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 75/100
aws-powertools/powertools-lambda-python#8726 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashed可能已有人在做 @Neeraj111010 於 1 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 80/100
aws-powertools/powertools-lambda-python#8725 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key value可能已有人在做 @sumedh-aerram 於 1 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 90/100
aws-powertools/powertools-lambda-python#8724 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 aws-powertools/powertools-lambda-python 的全部 Issue
相似的 Issue
-
area:scripts area:tests bug priority:later
難度 2/5 1-3 小時 新手友好度 72/100
Ikalus1988/MisakaNet#4358 ·
維護者通常 1 天內回覆
-
Discovered ports from service discovery are never propagated to modules in Module.load()可能已有人在做 @vishalmore90 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
OWASP/Nettacker#1828 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
aws-samples/sample-per-model-bedrock#708 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 75/100
sjkim1127/Reversecore_MCP#365 ·
維護者通常 1 天內回覆