_get_blocked_template() missing 1 required positional argument

オープン
#688 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
security

調査の方向性

datadog_lambda/asm.py:226 から開始し、報告された ddtrace のバージョン範囲と併せて http_utils._get_blocked_template の呼び出しを調査します。ASM を有効にした状態で引数不足による失敗を再現し、その後、影響を受けるコンテナデプロイメントでブロックされたレスポンスのパスが TypeError を発生させなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
102
フォーク
52
平均マージ
5日 19時間
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataDog/datadog-lambda-python のほかの issue

DataDog/datadog-lambda-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。