Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Feature]: stage out should check for valid collection version in collection ID #453

Open
ngachung opened this issue Oct 29, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@ngachung
Copy link
Collaborator

ngachung commented Oct 29, 2024

Using collection ID without version will cause catalog to fail e.g."collection": "urn:nasa:unity:unity:dev:nga-unity-dev-output"

2024-10-29 21:07:30,287 [ERROR] [cumulus_lambda_functions.granules_cnm_ingester.granules_cnm_ingester_logic::154] missing collection. (failed to create): urn:nasa:unity:unity:dev:nga-unity-dev-output

collection ID needs to include version e.g. "collection": "urn:nasa:unity:unity:dev:nga-unity-dev-output___1"

stage out should check that collection id stac items include version

Note: It appears that if no version is provided, a collection with default version of 001 is created.

@ngachung ngachung added the enhancement New feature or request label Oct 29, 2024
@wphyojpl
Copy link
Collaborator

wphyojpl commented Dec 8, 2024

I think this is fixed via https://github.com/unity-sds/mdps-ds-lib/pull/61/files and a4c85df

I remember having that issue when testing #432

@wphyojpl wphyojpl added the question Further information is requested label Dec 8, 2024
@ngachung
Copy link
Collaborator Author

ngachung commented Jan 9, 2025

Stage out works when providing collection without version and will default to version = 001. However, when calling unity_sds_client create_collection https://github.com/unity-sds/unity-monorepo/blob/main/libs/unity-py/unity_sds_client/services/data_service.py#L92, not providing version will cause the following error


[ERROR]	2025-01-09T01:22:02.469Z	0347861b-c15f-4780-b159-94f798310f93	error while creating new collection in Cumulus
Traceback (most recent call last):
  File "/var/task/cumulus_lambda_functions/uds_api/dapa/collections_dapa_creation.py", line 86, in create
    cumulus_collection_doc = collection_transformer.from_stac(self.__request_body)
  File "/var/task/mdps_ds_lib/lib/cumulus_stac/collection_transformer.py", line 491, in from_stac
    output_collection_cumulus['version'] = name_version[1]
IndexError: list index out of range

Maybe better documentation describing required format of collection ID (https://github.com/unity-sds/unity-monorepo/blob/main/libs/unity-py/unity_sds_client/resources/collection.py#L26) will be sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants