Skip to content

fix: use maap-py v5 download_granule, pin maap-py, retry STAC fetches - #23

Merged
sujen1412 merged 1 commit into
developfrom
fix/download-granule-and-stac-load
Oct 20, 2026
Merged

sujen1412 merged 1 commit into
developfrom
fix/download-granule-and-stac-load

Conversation

@sujen1412

Copy link
Copy Markdown
Collaborator

Problem

A UAT job for mocca-v29601 failed in input staging:

  • Every asset download logged MAAP.downloadGranule() got an unexpected keyword argument 'online_access_url'. In maap-py v5, downloadGranule is a stub that raises; the replacement is download_granule(online_access_url, destination_path, overwrite). The Dockerfile installed maap-py unpinned, so the rebuilt image picked up 5.1.0.
  • A transient CMR 503 made load_json_from_uri return None, and stage_in then crashed with AttributeError: 'NoneType' object has no attribute 'get'.

Changes

  • stage_in.py: call download_granule.
  • Pin maap-py==5.1.0 in environment.yaml and docker/Dockerfile.
  • create_inputs.py: retry HTTP fetches (4 attempts, backoff, 60s timeout) and raise Could not load STAC JSON for input '<name>' from <uri> if loading still fails.
  • Tests: a contract test against the installed maap-py signature, plus retry and download_granule tests. 77 tests pass locally with maap-py 5.1.0.

Not changed

Per-asset download errors in stage_in are still only printed, so a job can continue with empty catalogs. Worth a follow-up.

After merge

Rebuild the image, then re-register/re-run on UAT to verify the optional Directory? fix (550154d) end to end.

- stage_in: call download_granule (downloadGranule is a raising stub in
  maap-py v5, so every asset download failed with an unexpected
  'online_access_url' keyword error)
- pin maap-py==5.1.0 in environment.yaml and the Dockerfile
- create_inputs: retry transient HTTP errors (e.g. CMR 503) with backoff
  and a timeout, and raise a clear error instead of an AttributeError when
  a STAC input cannot be loaded
- tests: maap-py signature contract test, retry and download_granule tests
@sujen1412
sujen1412 merged commit 2dfb3d6 into develop Oct 20, 2026
2 checks passed
@sujen1412
sujen1412 deleted the fix/download-granule-and-stac-load branch October 20, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant