Add debugging to feed download process
Los mantenedores suelen responder en 2 días
@davidgamez ya está trabajando en esto.
Desde el 8/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 34
- Forks
- 7
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 21
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MobilityData/mobility-feed-api
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MobilityData/mobility-feed-api#1927 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
MobilityData/mobility-feed-api#1846 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
MobilityData/mobility-feed-api#1755 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MobilityData/mobility-feed-api#1647 ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MobilityData/mobility-feed-api#836 ·
Los mantenedores suelen responder en 2 días
Todos los issues de MobilityData/mobility-feed-api
Issues similares
-
ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
Los mantenedores suelen responder en 1 día
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to pythonPosiblemente ocupada @ronaldtse la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
pydantic/pytest-examples#102 · 1 comentario ·