Skip to content

_get_blocked_template() missing 1 required positional argument #688

@rithikanarayan

Description

@rithikanarayan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions