HLS data access issue: '.tif not recognized as being a supported file format'
-
- Posts: 5
- Joined: Fri Nov 22, 2024 4:26 pm America/New_York
- Endorsed: 1 time
HLS data access issue: '.tif not recognized as being a supported file format'
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)
Filters:
-
- User Services
- Posts: 117
- Joined: Tue Dec 03, 2024 2:37 pm America/New_York
- Has endorsed: 30 times
- Endorsed: 2 times
Re: HLS data access issue: '.tif not recognized as being a supported file format'
Hello @immerse8083 We are looking into this and will post an answer when we have more details. Thanks -- Danielle
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.
Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.
Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.
-
- Posts: 5
- Joined: Fri Nov 22, 2024 4:26 pm America/New_York
- Endorsed: 1 time
Re: HLS data access issue: '.tif not recognized as being a supported file format'
Thank you! Just to let you know, I was able to resolve the problem. It turned out I had accidentally added an extra new line in my netrc file, probably from copy and pasting in a new password. It seems this is somewhat commonly the cause of the 'tif not recognized at a supported file format' error, based on this github discussion:
https://github.com/rasterio/rasterio/issues/2152
https://github.com/rasterio/rasterio/issues/2152
-
- User Services
- Posts: 23
- Joined: Mon Mar 17, 2025 2:04 pm America/New_York
- Endorsed: 3 times
Re: HLS data access issue: '.tif not recognized as being a supported file format'
Hello immerse8083,
Thank you for the update, we will close the ticket then. Let us know if you have any further issues. Thanks,
Brett
Thank you for the update, we will close the ticket then. Let us know if you have any further issues. Thanks,
Brett