opendatacube / odc-stac

Load STAC items into xarray Datasets.
Apache License 2.0
129 stars 19 forks source link

Using `configure_s3_access` and `configure_rio` still requires setting the `AWS_NO_SIGN_REQUEST` environment variable #159

Open alexgleith opened 4 days ago

alexgleith commented 4 days ago

I expect either of odc.stac.configure_s3_access(aws_unsigned=True) or configure_rio(cloud_defaults=True, aws=dict(aws_unsigned=True)) to set up the environment so that I don't need AWS credentials for public read S3 objects.

In testing, neither of those functions works, and loading data from S3 URIs throws the error:

RasterioIOError: AWS_SECRET_ACCESS_KEY and AWS_NO_SIGN_REQUEST configuration options not defined, and /Users/username/.aws/credentials not filled

If I do:

import os
os.environ["AWS_NO_SIGN_REQUEST"] = "YES"

then the error goes away, and data can be loaded.

Versions:

I tried with and without Dask and both failed the same way.

Kirill888 commented 4 days ago

@alexgleith needs more info, in particular version of rasterio, version of odc-stac, whether this is a problem for dask, non-dask or both. There has been a handful of times in the past in rasterio that AWSSession had issues around that.

Kirill888 commented 4 days ago

this one worth checking out for example:

https://github.com/rasterio/rasterio/issues/2866