Add debugging to feed download process
Maintainer thường phản hồi trong vòng 2 ngày
@davidgamez đang làm issue này rồi.
Từ ngày 8/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 34
- Fork
- 7
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MobilityData/mobility-feed-api
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
MobilityData/mobility-feed-api#1927 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
MobilityData/mobility-feed-api#1846 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
MobilityData/mobility-feed-api#1755 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MobilityData/mobility-feed-api#1647 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MobilityData/mobility-feed-api#836 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của MobilityData/mobility-feed-api
Issue tương tự
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to pythonCó thể đã có người làm @ronaldtse đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pydantic/pytest-examples#102 · 1 bình luận ·