Request's response 502 Gateway error with limit set to 250
Posted: Thu Nov 09, 2023 7:31 pm America/New_York
Through a python script, I am sending a POST request to retrieve items from LPCLOUD STAC Catalog. My request parameters are as follows:
params = {'limit': 250, 'bbox': '-112.63573388436109,56.74522108547581,-110.83605841365043,57.74219208744419', 'datetime': '2023-01-02T00:00:00Z/2023-11-09T23:59:59Z', 'collections': ['HLSS30.v2.0']}
The POST command is like this:
items = requests.post(lp_search, json=params)
with lp_search being the search endpoint for the LPCLOUD STAC Catalog:
https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search
This results in response status code of 502 (bad Gateway server error). The way I can fix it is by reducing the 'limit' to 100.
I am wondering why the error happens with larger limits? In some requests (e.g. with a much shorter datetime range and a much smaller bbox), the limit of 250 matched items works fine. But, in some requests like the one above, a smaller limit should be used. Is there a safe way to determine this limit so that we would not get an unexpected response error?
params = {'limit': 250, 'bbox': '-112.63573388436109,56.74522108547581,-110.83605841365043,57.74219208744419', 'datetime': '2023-01-02T00:00:00Z/2023-11-09T23:59:59Z', 'collections': ['HLSS30.v2.0']}
The POST command is like this:
items = requests.post(lp_search, json=params)
with lp_search being the search endpoint for the LPCLOUD STAC Catalog:
https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search
This results in response status code of 502 (bad Gateway server error). The way I can fix it is by reducing the 'limit' to 100.
I am wondering why the error happens with larger limits? In some requests (e.g. with a much shorter datetime range and a much smaller bbox), the limit of 250 matched items works fine. But, in some requests like the one above, a smaller limit should be used. Is there a safe way to determine this limit so that we would not get an unexpected response error?