HLS data access issue: '.tif not recognized as being a supported file format'
Posted: Sun Jul 20, 2025 2:50 pm America/New_York
Hello! I am running into an issue accessing HLS data using the code below. This same code has run reliably for months, but recently I've started get this error message:
RuntimeError: Error opening 'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T18TWL.2017099T153859.v2.0/HLS.L30.T18TWL.2017099T153859.v2.0.Fmask.tif': RasterioIOError("'/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T18TWL.2017099T153859.v2.0/HLS.L30.T18TWL.2017099T153859.v2.0.Fmask.tif' not recognized as being in a supported file format.")
My access token is up to date. Do you have any insight into what might be causing this?
###### Relevant parts of my code #######
gdal.SetConfigOption('GDAL_HTTP_COOKIEFILE','~/cookies.txt')
gdal.SetConfigOption('GDAL_HTTP_COOKIEJAR', '~/cookies.txt')
gdal.SetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN','EMPTY_DIR')
gdal.SetConfigOption('GDAL_HTTP_UNSAFESSL', 'YES')
gdal.SetConfigOption('GDAL_HTTP_MAX_RETRY', '10')
gdal.SetConfigOption('GDAL_HTTP_RETRY_DELAY', '0.5')
gdal.SetConfigOption('CPL_VSIL_CURL_ALLOWED_EXTENSIONS','.tif,.tiff')
import earthaccess
earthaccess.login(strategy='netrc', persist=True)
catalog = Client.open("https://cmr.earthdata.nasa.gov/stac/LPCLOUD")
query_results = catalog.search(
bbox=self.site.bbox_4326,
collections=["HLSL30.v2.0","HLSS30.v2.0"],
datetime=f"{self.year}-04-01/{self.year}-11-30"
).item_collection()
.....
x = stackstac.stack(
query_results,
epsg=self.epsg,
resolution=30,
bounds=self.site.bbox_utm,
assets=bands).where(lambda x: x > 0, other=np.nan)
RuntimeError: Error opening 'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T18TWL.2017099T153859.v2.0/HLS.L30.T18TWL.2017099T153859.v2.0.Fmask.tif': RasterioIOError("'/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T18TWL.2017099T153859.v2.0/HLS.L30.T18TWL.2017099T153859.v2.0.Fmask.tif' not recognized as being in a supported file format.")
My access token is up to date. Do you have any insight into what might be causing this?
###### Relevant parts of my code #######
gdal.SetConfigOption('GDAL_HTTP_COOKIEFILE','~/cookies.txt')
gdal.SetConfigOption('GDAL_HTTP_COOKIEJAR', '~/cookies.txt')
gdal.SetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN','EMPTY_DIR')
gdal.SetConfigOption('GDAL_HTTP_UNSAFESSL', 'YES')
gdal.SetConfigOption('GDAL_HTTP_MAX_RETRY', '10')
gdal.SetConfigOption('GDAL_HTTP_RETRY_DELAY', '0.5')
gdal.SetConfigOption('CPL_VSIL_CURL_ALLOWED_EXTENSIONS','.tif,.tiff')
import earthaccess
earthaccess.login(strategy='netrc', persist=True)
catalog = Client.open("https://cmr.earthdata.nasa.gov/stac/LPCLOUD")
query_results = catalog.search(
bbox=self.site.bbox_4326,
collections=["HLSL30.v2.0","HLSS30.v2.0"],
datetime=f"{self.year}-04-01/{self.year}-11-30"
).item_collection()
.....
x = stackstac.stack(
query_results,
epsg=self.epsg,
resolution=30,
bounds=self.site.bbox_utm,
assets=bands).where(lambda x: x > 0, other=np.nan)