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

HyP3 API rejects S2 COG names that are 25 characters in length #1022

Closed
jhkennedy opened this issue May 19, 2022 · 0 comments · Fixed by #1026
Closed

HyP3 API rejects S2 COG names that are 25 characters in length #1022

jhkennedy opened this issue May 19, 2022 · 0 comments · Fixed by #1026
Assignees
Labels
bug Something isn't working

Comments

@jhkennedy
Copy link
Contributor

jhkennedy commented May 19, 2022

Example:

>>> import hyp3_sdk
>>> hyp3 = hyp3_sdk.HyP3()
>>> hyp3.submit_autorift_job(granule1='S2B_22XEQ_20190610_11_L1C', granule2='S2A_22XEQ_20190610_10_L1C')
Traceback (most recent call last):
  File "/home/asjohnston/miniconda3/lib/python3.9/site-packages/hyp3_sdk/exceptions.py", line 29, in _raise_for_hyp3_status
    response.raise_for_status()
  File "/home/asjohnston/miniconda3/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://hyp3-api.asf.alaska.edu/jobs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/asjohnston/miniconda3/lib/python3.9/site-packages/hyp3_sdk/hyp3.py", line 206, in submit_autorift_job
    return self.submit_prepared_jobs(prepared_jobs=job_dict)
  File "/home/asjohnston/miniconda3/lib/python3.9/site-packages/hyp3_sdk/hyp3.py", line 187, in submit_prepared_jobs
    _raise_for_hyp3_status(response)
  File "/home/asjohnston/miniconda3/lib/python3.9/site-packages/hyp3_sdk/exceptions.py", line 32, in _raise_for_hyp3_status
    raise HyP3Error(f'{response} {response.json()["detail"]}')
hyp3_sdk.exceptions.HyP3Error: <Response [400]> Value {'jobs': [{'job_parameters': {'granules': ['S2B_22XEQ_20190610_11_L1C', 'S2A_22XEQ_20190610_10_L1C']}, 'job_type': 'AUTORIFT'}]} not valid for schema of type object: (<ValidationError: "{'job_parameters': {'granules': ['S2B_22XEQ_20190610_11_L1C', 'S2A_22XEQ_20190610_10_L1C']}, 'job_type': 'AUTORIFT'} is not valid under any of the given schemas">,)

Some example valid scene names that are longer than our current limit:

S2B_22XEQ_20190610_11_L1C
S2A_22XEQ_20190610_10_L1C
S2B_23XMJ_20190609_10_L1C
S2A_23XMK_20190610_10_L1C
S2B_23XMK_20190610_11_L1C
S2B_23XNJ_20210518_10_L1C
S2B_23XNJ_20190610_10_L1C
S2A_23XNJ_20190509_10_L1C
S2A_23XNK_20190609_10_L1C
S2B_24XVP_20190610_10_L1C
S2A_24XVP_20190509_10_L1C
S2A_24XVQ_20190609_10_L1C
S2B_24XWP_20190610_10_L1C
S2A_24XWQ_20180817_10_L1C
S2B_25XDJ_20190610_10_L1C
S2A_25XDK_20180817_10_L1C
S2B_25XDK_20190610_10_L1C
S2B_25XEJ_20190610_10_L1C
S2B_25XEJ_20180817_10_L1C
S2A_25XEJ_20190721_10_L1C
S2B_26XMP_20190610_10_L1C

We'll need to adjust the autorift job specifications, e.g.:
https://github.com/ASFHyP3/hyp3/blob/develop/job_spec/AUTORIFT.yml#L29
https://github.com/ASFHyP3/hyp3/blob/develop/job_spec/AUTORIFT_ITS_LIVE.yml#L29

These tests will need to be updated:
https://github.com/ASFHyP3/hyp3/blob/develop/tests/test_api/test_submit_job.py#L257
https://github.com/ASFHyP3/hyp3/blob/develop/tests/test_api/test_submit_job.py#L279

@jhkennedy jhkennedy added the bug Something isn't working label May 19, 2022
@jhkennedy jhkennedy changed the title HyP3 API rejects S2 COG names that are 26 characters in length HyP3 API rejects S2 COG names that are 25 characters in length May 19, 2022
@forrestfwilliams forrestfwilliams self-assigned this May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants