rustic-rs / rustic

rustic - fast, encrypted, and deduplicated backups powered by Rust
https://rustic.cli.rs
Apache License 2.0
1.92k stars 71 forks source link

Region is needed when using custom s3 endpoint #1304

Open kkettinger opened 1 week ago

kkettinger commented 1 week ago

Currently testing out the hetzner object storage beta with this config:

[repository]
repository = "opendal:s3"
password = "XXX"

[repository.options]
access_key_id = "XXX"
secret_access_key = "XXX"
bucket = "bucket-name"
root = "/"
endpoint = "https://fsn1.your-objectstorage.com"
# region = "us-east-1"

When not using region, opendal fails:

error: backend openDAL Backend cannot be loaded: ConfigInvalid (permanent) at Builder::build, context: { service: s3 } => region is missing. Please find it by S3::detect_region() or set them in env.

When commenting out the region key, it works.

aawsome commented 1 week ago

Thanks for opening this issue @kkettinger

This is actually how opendal is working, see https://opendal.apache.org/docs/rust/opendal/services/struct.S3.html.

We can't fix this in rustic. If you want to have it fixed, can you please open an issue for opendal: https://github.com/apache/opendal/issues/new/choose

Thanks!

simonsan commented 1 week ago

// Set the region. This is required for some services, if you don't care about it, for example Minio service, just set it to "auto", it will be ignored.

Probably worth to keep it, and set it to 'auto', then?

kkettinger commented 1 week ago

// Set the region. This is required for some services, if you don't care about it, for example Minio service, just set it to "auto", it will be ignored.

Probably worth to keep it, and set it to 'auto', then?

Setting to "auto" works!