Add debugging to feed download process
メンテナーはふだん 2 日以内に返信
@davidgamez がすでに取り組んでいます。
2026年10月8日 から。
評価
この issue はまだ評価されていません。
説明
Describe the problem
Description
A feed fails nightly in batch_process_dataset but succeeds when reproduced by hand, from a laptop and from a GCE VM running the exact production client (urllib3 + create_feed_ssl_context + same headers). IP blocking and TLS fingerprinting are ruled out. download_and_get_hash discards everything about the failed request; all we get is ValueError: Invalid HTTP response code: [N].
Proposed solution
1. Diagnostics in the shared download path: functions-python/helpers/utils.py
- Capture per attempt: request headers, resolved URL, response headers, status code, latency, redirect chain, content type, is_zip, error type/message.
- Sanitize before logging or storing: redact values for
authorization,cookie,x-api-key,token, and any header or query param matching the feed'sapi_key_parameter_name; strip URL userinfo. Names kept, values redacted. - Capture external IP on the failure path, cached per process.
download_feed(..., max_bytes=None)raisesFeedDownloadErrorcarrying the diagnostics.download_and_get_hashkeeps its current signature and return value.build_feed_request_paramsfalls back to default headers when the config DB is unreachable.
2. Persist failures: gtfs_feed_availability_check
- Liquibase changeset adding nullable
source,request_headers,response_headers,redirect_urls,external_ip,resolved_url. Backfill existing rows tosource='availability_check'. batch_process_datasetwrites one row withsource='dataset_download'on download failure.
3. Operations endpoint: POST /v1/operations/gtfs_feeds/{id}/download_debug
- Runs the download through the same shared functions and returns the diagnostics.
max_bytescap (~50MB).- Spec in
docs/OperationsAPI.yaml, impl infeeds_operations_impl.py.
4. Local script: scripts/download-verifier.sh --url <url>
- Self-sufficient, same conventions as
function-python-run.sh: symlinks shared code, builds venv, runs the verifier. download_verifier.pygains--url/--feed_id/--skip-upload, replacing the hardcodedPRODUCER_URL, and passes the real feed id todownload_content.
Alternatives you've considered
No response
Additional context
No response
- 主要言語
- Python
- スター
- 34
- フォーク
- 7
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MobilityData/mobility-feed-api のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MobilityData/mobility-feed-api#1927 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MobilityData/mobility-feed-api#1846 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
MobilityData/mobility-feed-api#1755 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MobilityData/mobility-feed-api#1647 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MobilityData/mobility-feed-api#836 ·
メンテナーはふだん 2 日以内に返信
MobilityData/mobility-feed-api の issue をすべて見る
似ている issue
-
ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
メンテナーはふだん 1 日以内に返信
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to python対応中かも @ronaldtse が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pydantic/pytest-examples#102 · コメント 1 件 ·