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

Intermittent 400 response when loading HLS data #272

Closed
waltersdan opened this issue Feb 7, 2023 · 2 comments
Closed

Intermittent 400 response when loading HLS data #272

waltersdan opened this issue Feb 7, 2023 · 2 comments
Labels
[Status] Triage [Type] Bug Something isn't working

Comments

@waltersdan
Copy link

Hi there,
I'm having intermittent issues accessing both the HLS S30 and L30 data. I am using pystac to search and stackstac to create xarray stacks for a series of tiles. Each tile is roughly 1000x1000 pixels, 300 timesteps, 7 bands. I have a local dask cluster running with 64 workers. I load the actual data into memory using something like:

arr = stack.to_numpy().astype('uint16')

And then I do some local processing on the data. This works for, say, 40 out of 45 tiles with no issue, each transferring to my local memory in about 5 minutes. However, sometimes I get an exception like:

Exception: 'RuntimeError("Error opening \'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T09UXR.2022289T194411.v2.0/HLS.S30.T09UXR.2022289T194411.v2.0.B12.tif\': RasterioIOError(\'HTTP response code: 400\')")'

I have my download code wrapped with the retry module, with a delay of 10s, backoff 20s. Sometimes this clears after one error, other times it repeats. When it repeats, the offending .tif is sometimes the same, sometimes not.

I did try adding the GDAL http retry options (https://gdal.org/user/virtual_file_systems.html) per this suggestion (gjoseph92/stackstac#18):

dist_env = stackstac.DEFAULT_GDAL_ENV.updated(dict( GDAL_DISABLE_READDIR_ON_OPEN='TRUE', GDAL_HTTP_COOKIEFILE=os.path.expanduser('~/cookies.txt'), GDAL_HTTP_COOKIEJAR=os.path.expanduser('~/cookies.txt'), GDAL_HTTP_MAX_RETRY=5, GDAL_HTTP_RETRY_DELAY=5) )

which I pass to stackstac, but that doesn't seem to do anything, probably because GDAL retry codes don't include 400.

Any ideas would be much appreciated

@jaybarra jaybarra added [Type] Bug Something isn't working [Status] Triage labels Feb 16, 2023
@william-valencia
Copy link
Contributor

@waltersdan Are you still having this issue?

@waltersdan
Copy link
Author

I have not noticed it in some time, although I do wrap all my download code with a retry wrapper which works around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Triage [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants