OPS C2098746297-LARC (MOP02T) #46160
GitHub Actions / Tested with Harmony
failed
Dec 24, 2024 in 0s
2 fail in 12m 31s
Annotations
Check warning on line 0 in tests.verify_collection
github-actions / Tested with Harmony
test_spatial_subset[C2098746297-LARC] (tests.verify_collection) failed
test-results/test_report.xml [took 6m 49s]
Raw output
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://harmony.earthdata.nasa.gov/jobs/fc084105-bce1-4834-9ac5-8385e359955b?linktype=https
collection_concept_id = 'C2098746297-LARC', env = 'ops'
granule_json = {'meta': {'collection-concept-id': 'C2098746297-LARC', 'concept-id': 'G2857862696-LARC', 'concept-type': 'granule', 'f... 'ProducerGranuleId'}], 'ProductionDateTime': '2024-01-05T13:34:21.000Z'}, 'GranuleUR': 'SC:MOP02T.009:69041122', ...}}
collection_variables = [{'associations': {'collections': [{'concept-id': 'C2098746297-LARC'}]}, 'meta': {'association-details': {'collections...cription': 'Extracted from _FillValue metadata attribute', 'Type': 'SCIENCE_FILLVALUE', 'Value': -9999.0}], ...}}, ...]
harmony_env = <Environment.PROD: 4>
tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_spatial_subset_C2098746290')
bearer_token = 'eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIj...0nlL-K596RCI-k0gbQsTkkjAtWl2o7dAugcj3VuU0Wx3jDeAYyzGA-P2mt852xfkroyDelavsXnCL4W8iyrZudHxVJ4wLhdsH-xJn6npOrQ_-SuR9UtewA'
skip_spatial = set()
@pytest.mark.timeout(1200)
def test_spatial_subset(collection_concept_id, env, granule_json, collection_variables,
harmony_env, tmp_path: pathlib.Path, bearer_token, skip_spatial):
test_spatial_subset.__doc__ = f"Verify spatial subset for {collection_concept_id} in {env}"
if collection_concept_id in skip_spatial:
pytest.skip(f"Known collection to skip for spatial testing {collection_concept_id}")
logging.info("Using granule %s for test", granule_json['meta']['concept-id'])
# Compute a box that is smaller than the granule extent bounding box
north, south, east, west = get_bounding_box(granule_json)
east, west, north, south = create_smaller_bounding_box(east, west, north, south, .95)
start_time = granule_json['umm']["TemporalExtent"]["RangeDateTime"]["BeginningDateTime"]
end_time = granule_json['umm']["TemporalExtent"]["RangeDateTime"]["EndingDateTime"]
# Build harmony request
harmony_client = harmony.Client(env=harmony_env, token=bearer_token)
request_bbox = harmony.BBox(w=west, s=south, e=east, n=north)
request_collection = harmony.Collection(id=collection_concept_id)
harmony_request = harmony.Request(collection=request_collection, spatial=request_bbox,
granule_id=[granule_json['meta']['concept-id']])
logging.info("Sending harmony request %s", harmony_client.request_as_url(harmony_request))
# Submit harmony request and download result
job_id = harmony_client.submit(harmony_request)
logging.info("Submitted harmony job %s", job_id)
> harmony_client.wait_for_processing(job_id, show_progress=False)
verify_collection.py:462:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/harmony/harmony.py:1144: in wait_for_processing
progress, status, message = self.progress(job_id)
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/harmony/harmony.py:1091: in progress
self._handle_error_response(response)
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/harmony/harmony.py:916: in _handle_error_response
response.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [502]>
def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""
http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason
if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)
elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)
if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://harmony.earthdata.nasa.gov/jobs/fc084105-bce1-4834-9ac5-8385e359955b?linktype=https
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/requests/models.py:1024: HTTPError
--------------------------------- Captured Log ---------------------------------
INFO root:verify_collection.py:441 Using granule G2857862696-LARC for test
INFO root:verify_collection.py:457 Sending harmony request https://harmony.earthdata.nasa.gov/C2098746297-LARC/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&subset=lat%28-85.5%3A85.5%29&subset=lon%28-171.0%3A171.0%29&granuleId=G2857862696-LARC&variable=all
INFO root:verify_collection.py:461 Submitted harmony job fc084105-bce1-4834-9ac5-8385e359955b
Check warning on line 0 in tests.verify_collection
github-actions / Tested with Harmony
test_temporal_subset[C2098746297-LARC] (tests.verify_collection) failed
test-results/test_report.xml [took 5m 39s]
Raw output
Exception: ('Forbidden', 'Error: You are not authorized to access the requested resource')
collection_concept_id = 'C2098746297-LARC', env = 'ops'
granule_json = {'meta': {'collection-concept-id': 'C2098746297-LARC', 'concept-id': 'G2857862696-LARC', 'concept-type': 'granule', 'f... 'ProducerGranuleId'}], 'ProductionDateTime': '2024-01-05T13:34:21.000Z'}, 'GranuleUR': 'SC:MOP02T.009:69041122', ...}}
collection_variables = [{'associations': {'collections': [{'concept-id': 'C2098746297-LARC'}]}, 'meta': {'association-details': {'collections...cription': 'Extracted from _FillValue metadata attribute', 'Type': 'SCIENCE_FILLVALUE', 'Value': -9999.0}], ...}}, ...]
harmony_env = <Environment.PROD: 4>
tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_temporal_subset_C209874620')
bearer_token = 'eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIj...0nlL-K596RCI-k0gbQsTkkjAtWl2o7dAugcj3VuU0Wx3jDeAYyzGA-P2mt852xfkroyDelavsXnCL4W8iyrZudHxVJ4wLhdsH-xJn6npOrQ_-SuR9UtewA'
skip_temporal = {'C2036882456-POCLOUD', 'C2205121315-POCLOUD'}
@pytest.mark.timeout(1200)
def test_temporal_subset(collection_concept_id, env, granule_json, collection_variables,
harmony_env, tmp_path: pathlib.Path, bearer_token, skip_temporal):
test_spatial_subset.__doc__ = f"Verify temporal subset for {collection_concept_id} in {env}"
if collection_concept_id in skip_temporal:
pytest.skip(f"Known collection to skip for temporal testing {collection_concept_id}")
logging.info("Using granule %s for test", granule_json['meta']['concept-id'])
start_time = granule_json['umm']["TemporalExtent"]["RangeDateTime"]["BeginningDateTime"]
end_time = granule_json['umm']["TemporalExtent"]["RangeDateTime"]["EndingDateTime"]
temporal_subset = get_half_temporal_extent(start_time, end_time)
# Build harmony request
harmony_client = harmony.Client(env=harmony_env, token=bearer_token)
request_collection = harmony.Collection(id=collection_concept_id)
harmony_request = harmony.Request(collection=request_collection,
granule_id=[granule_json['meta']['concept-id']],
temporal=temporal_subset)
logging.info("Sending harmony request %s", harmony_client.request_as_url(harmony_request))
# Submit harmony request and download result
job_id = harmony_client.submit(harmony_request)
logging.info("Submitted harmony job %s", job_id)
> harmony_client.wait_for_processing(job_id, show_progress=False)
verify_collection.py:591:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/harmony/harmony.py:1144: in wait_for_processing
progress, status, message = self.progress(job_id)
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/harmony/harmony.py:1091: in progress
self._handle_error_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <harmony.harmony.Client object at 0x7f0a05f50070>
response = <Response [403]>
def _handle_error_response(self, response: Response):
"""Raises the appropriate exception based on the response
received from Harmony. Tries to pull out an error message
from a Harmony JSON response when possible.
Args:
response: The Response from Harmony
Raises:
Exception with a Harmony error message or a more generic
HTTPError
"""
if 'application/json' in response.headers.get('Content-Type', ''):
exception_message = None
try:
response_json = response.json()
if hasattr(response_json, 'get'):
exception_message = response_json.get('description')
if not exception_message:
exception_message = response_json.get('error')
except JSONDecodeError:
pass
if exception_message:
> raise Exception(response.reason, exception_message)
E Exception: ('Forbidden', 'Error: You are not authorized to access the requested resource')
../../../../.cache/pypoetry/virtualenvs/l2ss-py-autotest-iYz8Sff2-py3.10/lib/python3.10/site-packages/harmony/harmony.py:915: Exception
--------------------------------- Captured Log ---------------------------------
INFO root:verify_collection.py:572 Using granule G2857862696-LARC for test
INFO root:verify_collection.py:585 Sending harmony request https://harmony.earthdata.nasa.gov/C2098746297-LARC/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&subset=time%28%222023-11-26T05%3A59%3A58.860000%22%3A%222023-11-26T17%3A59%3A53.660000%22%29&granuleId=G2857862696-LARC&variable=all
INFO root:verify_collection.py:589 Submitted harmony job 530a8ad6-be77-4044-9294-cf2f9a94cab7
Loading