Status: the application this served is being replaced, and the job manifest is deleted. This runbook
exists because the job encoded knowledge that took real debugging to acquire, and the manifest that held it
(k8s/apps/meghmitra/jobs/ingest-corpus-job.yaml, a ConfigMap-embedded download_dacp.py) is gone from the
working tree as of 2026-09-29 (CLEAN-001). The full script is in git history — git log --follow --
k8s/apps/meghmitra/jobs/ingest-corpus-job.yaml — and belongs in the owning application’s repository if it is
ever needed again, not here.
Downloaded every District Agriculture Contingency Plan (DACP) PDF from ICAR-CRIDA’s public index
(https://www.icar-crida.res.in/Crop_Contingency_Plan.html) into data/raw/<State>/<filename>.pdf, for the
corpus the application then ingested. It ran as a one-off Job applied from this repository — never a CronJob,
never in an image build — because it needs outbound internet to one specific government host and writes into
the application’s data tree.
<a> tags are never closed, so a strict parser refuses it. The
script scanned sequentially for a state header and took every following PDF anchor as belonging to that
state, tolerating the missing </a>. A tolerant scan, not a parser.icar-crida.res.in is slow and flaky, and it is a hard prerequisite. The first
request gates the whole run, and repeated multi-attempt timeouts were observed at a bare 30 s with no
retry — the script used a generous timeout with retries. A one-off blip and a systemic problem look
identical here; treat the first fetch’s failure as the latter.ThreadPoolExecutor (--workers 12) with
per-file error isolation and a subprocess timeout that a hung connection could still outlive — hence the
explicit handling around each future rather than around the pool.%PDF is skipped, so
re-running picks up only documents ICAR-CRIDA adds or renames. There is no manifest of what “should” exist —
the index is the source of truth on every run..part file and is renamed into place, so an interrupted
run leaves no half-PDF that a later run would treat as valid.