-
Notifications
You must be signed in to change notification settings - Fork 5
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
Tiling/AWS Session problems in veda-dev #192
Comments
@anayeaye this is the issue we encountered before where the endpoint was failing intermittently. The problem that time was the creds weren't being passed to gdal. This is what that fix looked like: https://github.com/NASA-IMPACT/veda-backend/pull/144/files The error that we're seeing now:
looks very similar to what we saw in the previous issue. |
In the PR we had some changes to how GDAL envs are passed through titiler based on the 0.7.0 breaking changes: https://github.com/developmentseed/titiler/blob/main/CHANGES.md#070-2022-06-08 Do we know if these gdal config changes were tested in dev? |
Just for the record (no new insights): I tried some pinning in the raster-api. These changes did not solve our problem and the dev deployment is reverted to the current develop branch. To be extra sure we weren't getting the breaking version of starlette. This looked promising because there is some subtle difference between the cold start true/false conditions that cause slightly different results on multiple tries of the same request (examples in the issue description).
And on a whim, to see if the recent release of rasterio was related to our woes
So our current condition remains: |
mosaic and stac may use another level of Can you test by setting |
With EDIT/note: I've now reverted the lambda environment to match the env variables stored for github actions: |
@vincentsarago: My hacky fix for this issue created a success case for The issue explained:
|
Thanks so much @ranchodeluxe for this deep dive. This is definitely a bug that we should fix at rio-tiler level I wonder if using a combination of https://github.com/rasterio/rasterio/blob/main/rasterio/env.py#L328C1-L339C1 to get the options in the environment and forward them to a new Env will work 🤷 |
FYI this can be simply demo with with rasterio.Env(
session=AWSSession(
aws_access_key_id="MyDevseedId",
aws_secret_access_key="MyDevseedKey",
)
):
with rasterio.open("s3://ds-satellite/cogs/NaturalEarth/world_grey.tif") as src:
print(src.profile)
with rasterio.Env():
with rasterio.open("s3://ds-satellite/cogs/NaturalEarth/world_grey_1024_512.tif") as src:
print(src.profile)
{'driver': 'GTiff', 'dtype': 'uint8', 'nodata': None, 'width': 21580, 'height': 10780, 'count': 3, 'crs': CRS.from_epsg(4326), 'transform': Affine(0.01666666666667, 0.0, -179.8333333333333,
0.0, -0.01666666666667, 89.83333333333331), 'blockxsize': 128, 'blockysize': 128, 'tiled': True, 'compress': 'jpeg', 'interleave': 'pixel', 'photometric': 'ycbcr'}
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
RasterioIOError: Access Denied |
ok, I may have a I see veda raster-api is a bit behind the actual version (titiler-pgstac=0.2.3 / titiler 0.10.2), ideally I'll release titiler-pgstac 0.5 and titiler 0.12 with a new rio-tiler 4.2 The move from titiler-pgstac 0.2.3 to 0.5 will have couple breaking changes:
|
I'm confused as to why |
Even in the same thread it seems the session is not forwarded. I'm opening an issue in rasterio because to me it seems to be a Bug |
Yeah, based on the code I'm reading it is a bug |
@vincentsarago : For a single thread nested import rasterio
import pprint
session = {
"session": rasterio.session.AWSSession(
aws_access_key_id="<blah>",
aws_secret_access_key="<blah>",
aws_session_token="<blah>",
)
}
with rasterio.Env(**session) as rioenv1:
print('########### rioenv1 ###########')
pprint.pprint(rioenv1.options, indent=4)
with rasterio.open("s3://veda-data-store-staging/geoglam/CropMonitor_202001.tif") as src:
pprint.pprint(src.profile, indent=4)
with rasterio.Env() as rioenv2:
print('########### rioenv2 ###########')
pprint.pprint(rioenv2.options, indent=4)
with rasterio.open("s3://veda-data-store-staging/geoglam/CropMonitor_202001.tif") as src:
pprint.pprint(src.profile, indent=4) |
Note: the second call should fails but because I've got my default AWS profile as devseed it works 😅 |
@ranchodeluxe feel free to add more comments in the rasterio ticket 🙏 |
will do, but I have to build my |
After asking around, it appears this has been resolved for the time being. The ultimate fix is in rasterio, so the next step is bumping rasterio versions once the next release is cut (>1.3.9) |
What
We are attempting to promote a large diff from our dev backend to staging but have encountered problems with the maps in the discovery and explore views of a preview of the dashboard running against the development backend. This is a hard error to document because a request for /cog/info that fails on first attempt succeeds when attempted a second time (I've seen that before but don't recall our answer at the moment). I suspect at least some of the solution may be in our raster-api GDAL environment, perhaps the configuration has drifted?
Dashboard preview:
https://deploy-preview-281--visex.netlify.app/
Mosaic examples
Failing mosaic in dev
https://dev-raster.delta-backend.com/mosaic/tiles/795277e64375a264bf3f73506a6cd2d0/WebMercatorQuad/2/0/1@1x?assets=cog_default&resampling=bilinear&bidx=1&colormap_name=rdylbu_r&rescale=0,1
First try:
'/vsis3/veda-data-store-staging/OMSO2PCA-COG/OMSO2PCA_LUT_SCD_2005.tif' does not exist in the file system, and is not recognized as a supported dataset name.
Second attempt after executing /cog/info:
Read or write failed. IReadBlock failed at X offset 0, Y offset 0: /vsis3/veda-data-store-staging/OMSO2PCA-COG/OMSO2PCA_LUT_SCD_2005.tif, band 1: IReadBlock failed at X offset 0, Y offset 0: TIFFReadEncodedTile() failed."
Mosaic works in staging
https://staging-raster.delta-backend.com/mosaic/tiles/795277e64375a264bf3f73506a6cd2d0/WebMercatorQuad/2/0/1@1x?assets=cog_default&resampling=bilinear&bidx=1&colormap_name=rdylbu_r&rescale=0,1
COG info examples
Note we are unable to read COG info for the file for the mosaic but can access other files in the same collection so it is not purely a permission issue
https://dev-raster.delta-backend.com/cog/info?url=s3://veda-data-store-staging/OMSO2PCA-COG/OMSO2PCA_LUT_SCD_2005.tif
On first attempt: ``'/vsis3/veda-data-store-staging/OMSO2PCA-COG/OMSO2PCA_LUT_SCD_2005.tif' does not exist in the file system, and is not recognized as a supported dataset name.`
On second attempt: endpoint returns cog/info
These are yearly COGs so the error should be reproducible by incrementing the date in the tif name.
COG Tiles example
We already know that /cog is handling the env, this tiles example works as expected.
https://dev-raster.delta-backend.com/cog/tiles/WebMercatorQuad/0/0/0@1x?url=s3://veda-data-store-staging/OMSO2PCA-COG/OMSO2PCA_LUT_SCD_2005.tif&bidx=1&rescale=0,1
Stack Notes
We cannot make a one to one comparison of the dev and staging veda-backend stacks because we have upgraded the version of pgstac for the dev database but not staging.
Similarities
Differences
The text was updated successfully, but these errors were encountered: