Description
Admin export for some image-transcription / line-alignment batches (e.g. 613 tasks, ~8 MB) fails via openpecha-annotation-tools.web.app: 503 first byte timeout, fake CORS errors, or 429 after retries. Same export works on Cloud Run (~2 min, 200 OK).
Batch id: UEcaB9BXL25JCUUK43hoc
Batch name: line-alignment-01
Investigation report:
- Export builds full JSON + char-diff before sending anything (~2 min for text-heavy batches).
- Firebase Hosting caps ~60s to first byte — can’t raise per route; function allows 540s but Hosting cuts off first.
- Retries/overlap (Hosting + user/UI) spawn multiple long exports → 429 (max_instances=10).
- Not much of an issue with Neo4j data (613 rows in ~1s; no duplicate contributions).
https://stackoverflow.com/questions/58759906/firebase-hosted-cloud-function-retrying-on-any-request-that-takes-60s-even-when
Fix
-
Admin UI only: export via Cloud Run URL (api-….run.app/api), not web.app. Spinner, 3+ min client timeout, no retry, blob → download. Low effort, same API(only frontend changes).
-
Async export: POST → job id → worker → GCS → poll → download. Works on web.app. Higher effort.
Description
Admin export for some image-transcription / line-alignment batches (e.g. 613 tasks, ~8 MB) fails via openpecha-annotation-tools.web.app: 503 first byte timeout, fake CORS errors, or 429 after retries. Same export works on Cloud Run (~2 min, 200 OK).
Batch id: UEcaB9BXL25JCUUK43hoc
Batch name: line-alignment-01
Investigation report:
https://stackoverflow.com/questions/58759906/firebase-hosted-cloud-function-retrying-on-any-request-that-takes-60s-even-when
Fix
Admin UI only: export via Cloud Run URL (api-….run.app/api), not web.app. Spinner, 3+ min client timeout, no retry, blob → download. Low effort, same API(only frontend changes).
Async export: POST → job id → worker → GCS → poll → download. Works on web.app. Higher effort.