I've been trying to setup the aws-sdk-s3 library to talk to a local MinIO S3 instance, but I keep hitting a deadend wheneven I call any method other than list_buckets
. The error I get is the following:
panicked at 'called `Result::unwrap()` on an `Err` value: ServiceError(ServiceError { source: Unhandled(Unhandled { source: ErrorMetadata { code: Some("SignatureDoesNotMatch"), message: Some("The request signature we calculated does not match the signature you provided. Check your key and signing method.")
Things that I have tried, include:
- Setting the endpoint configuration directly in the aws config (a.k.a. just following the examples provided in the library's repository):
let region_provider = RegionProviderChain::first_try(Region::new("us-west-2"));
let shared_config = aws_config::from_env().credentials_provider(Credentials::new("development", "development", None, None, "s3")).endpoint_url("http://localhost:9000").region(region_provider).load().await;
-
Change MinIO's port to 80, since there are several search results pointing to a known bug in AWS SDKs where the SDK does not consider the port for the signature.
-
Use a config builder so that I can pass the
force_path_style
flag:
let client_config = Builder::new()
.region(Region::new("eu-central-1"))
.credentials_provider(Credentials::new("development", "development", None, None, "example"))
.endpoint_url("http://localhost")
.force_path_style(true)
.build();
I must be missing something, but can't figure out what that could be, hence why I'm asking to check if someone from the community has a similar, working development environment.
Note: Everything works with the rust-s3 library, so it's definitely something with the official AWS SDK configuration.