cscli hub update: intermittent 'connection reset' on HEAD via IPv6 to cdn-hub.crowdsec.net
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、リポジトリ内で警告テキスト 'Failed to check last modified' をgrepし、cscli hub update の際にcscliがハブの .index.json に対してHEADリクエストを発行する箇所を特定する。HEADプローブの失敗を、既存のGETフォールバックを維持したまま、デバッグ/詳細ログ(verbose)に格下げできるか(Issueにおける軽減策1)を判断し、IPv4を優先するためのコードパスやフラグがすでに存在するかを確認する。完了の定義:cscli hub update を実行しても、HEADの失敗時に不気味なWARNINGが表示されなくなり、フォールバックは引き続き成功すること。なお、このIssueは141日間沈黙しておりコメントは2件のみなので、コーディング前にメンテナーにどの軽減策を望んでいるか確認すること。
索引モデルが issue の本文から書いたものです。
説明
Description
cscli hub update consistently logs a warning about a failed HEAD request to cdn-hub.crowdsec.net when the host has dual-stack (IPv4 + IPv6) connectivity. The HEAD request is sent over IPv6 to a CloudFront edge node and gets read: connection reset by peer. The update still succeeds because cscli falls back to GET, but the warning is noisy and confusing.
Reproduction
Server with working dual-stack IPv4/IPv6 connectivity.
$ cscli hub update
WARNING Failed to check last modified: failed to make HEAD request for https://cdn-hub.crowdsec.net/crowdsecurity/master/.index.json:
Head "https://cdn-hub.crowdsec.net/crowdsecurity/master/.index.json":
read tcp [2a02:121f:1dd:8001::2000]:58536->[2600:9000:202a:4800:b:9c87:4c80:93a1]:443: read: connection reset by peer
Downloading /etc/crowdsec/hub/.index.json
Nothing to do, the hub index is up to date.
Isolated test
# IPv6 HEAD — fails intermittently (~2/3 attempts timeout/RST)
$ for i in 1 2 3; do curl -6 -sI --max-time 5 -X HEAD https://cdn-hub.crowdsec.net/crowdsecurity/master/.index.json | head -1; done
(empty)
(empty)
HTTP/2 200
# IPv4 HEAD — always succeeds
$ curl -4 -sI --max-time 5 -X HEAD https://cdn-hub.crowdsec.net/crowdsecurity/master/.index.json | head -1
HTTP/2 200
# IPv6 GET — always succeeds
$ curl -6 -sI --max-time 5 https://cdn-hub.crowdsec.net/crowdsecurity/master/.index.json | head -1
HTTP/2 200
So the failure is specific to HEAD requests over IPv6 hitting certain CloudFront edges. Different edge nodes are contacted on each retry (different /48 prefixes within 2600:9000:*), and only some respond correctly to HEAD over IPv6.
Environment
- CrowdSec:
v1.7.8-debian-pragmatic-amd64-63227459(codenamealphaga, GoVersion 1.26.2) - OS: Ubuntu 24.04.4 LTS, kernel 6.8.0-111-generic
- Network: dual-stack, MTU 1500 on
enp6s18, no firewall blocking outbound IPv6
Suspected cause
CloudFront edge configuration inconsistency on IPv6: some edges return HTTP/2 200 for HEAD, others reset the connection. This is upstream (AWS/CloudFront or CrowdSec's CDN config), not a CrowdSec code bug per se.
Suggested mitigations on the cscli side
- Treat HEAD failures as a soft error and fall back to GET silently (current behavior already falls back, but logs a
WARNINGthat confuses operators). - Add a
--prefer-ipv4flag, or document the workaround (/etc/gai.confprecedence override, or/etc/hostspin to an IPv4 CloudFront address). - Open an upstream ticket with the CDN provider to fix the inconsistent HEAD-over-IPv6 behavior.
Happy to provide more traces (tcpdump, etc.) if useful.
- 主要言語
- Go
- スター
- 15.1k
- フォーク
- 726
- 平均マージ
- 2日 51分
- マージ済み PR(30日)
- 18
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crowdsecurity/crowdsec のほかの issue
-
[docker] Align build and debian release対応中かも @albundy83 が 2 日前に担当しました。 オープンkind/enhancement needs/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
crowdsecurity/crowdsec#4803 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
Bucket queues preallocate all their slots when the bucket is created対応中かも @AdzerKI が 4 日前に担当しました。 オープンkind/bug needs/triage os/linux
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
crowdsecurity/crowdsec#4799 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
kind/bug needs/triage os/linux
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
crowdsecurity/crowdsec#4797 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
needs/kind needs/triage
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
crowdsecurity/crowdsec#4795 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
kind/bug needs/triage os/linux
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
crowdsecurity/crowdsec#4790 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
crowdsecurity/crowdsec の issue をすべて見る
似ている issue
-
govulncheck reports 7 reachable vulnerabilities in dependencies対応中かも @dwisiswant0 が今日担当しました。 オープンType: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
projectdiscovery/rawhttp#558 ·
-
govulncheck reports 8 vulnerabilities in called code対応中かも @dwisiswant0 が今日担当しました。 オープンType: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
projectdiscovery/vulnx#517 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
rubys/roundhouse#1946 ·