_get_blocked_template() missing 1 required positional argument
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start at datadog_lambda/asm.py:226 and inspect the call to http_utils._get_blocked_template alongside the reported ddtrace version range. Reproduce the missing-argument failure with ASM enabled, then verify the blocked-response path no longer raises the TypeError for affected container deployments.
Written by the indexing model from the issue text.
Description
Customers encountering the following error
def get_asm_blocked_response(
event_source: _EventSource,
) -> Optional[Dict[str, Any]]:
"""Get the blocked response for the given event source."""
if event_source.event_type not in _http_event_types:
return None
blocked = get_blocked()
if not blocked:
return None
desired_type = blocked.get("type", "auto")
if desired_type == "none":
content_type = "text/plain; charset=utf-8"
content = ""
else:
content_type = blocked.get("content-type", "application/json")
content = http_utils._get_blocked_template(content_type)
E TypeError: _get_blocked_template() missing 1 required positional argument: 'security_response_id'
datadog_lambda/asm.py:226: TypeError
or similar errors related to the _get_blocked_template function signature should check the version of ddtrace they are using. Customers encountering this error are likely using lambda with containers and/or have overridden the version of ddtrace packaged with the Datadog Python Lambda Layer. If you are using ddtrace v3.19.0 or above and have ASM enabled, please downgrade to a ddtrace version between v3.16.2 and v3.18.1.
Customers not using ddtrace v3.19.0 or above should not be affected by this issue.
- Dominant language
- Python
- Stars
- 102
- Forks
- 52
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/datadog-lambda-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
DataDog/datadog-lambda-python#758 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
DataDog/datadog-lambda-python#755 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
DataDog/datadog-lambda-python#682 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataDog/datadog-lambda-python#666 · 1 reaction ·
-
DataDog/datadog-lambda-python#633 · 2 comments · 1 assignee ·
All issues in DataDog/datadog-lambda-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100