Comment 7 for bug 1003159

Justin Myers (myersjustinc) wrote :

Started to look into this myself, since my NAS (my normal Duplicity destination) is configured to copy my backups to an S3 bucket in `ca-central-1`, and I ran into this bug when seeing whether I could restore directly from that location.

I've only attempted reads so far, but I'm able to interact with this non-default bucket just fine if I use one of the endpoint hostnames listed here: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

This fails for the aforementioned bucket with a 409 (Conflict)

```
$ duplicity collection-status "s3+http://${BUCKET}/${PREFIX}"
```

This succeeds:

```
$ duplicity collection-status "s3://s3.ca-central-1.amazonaws.com/${BUCKET}/${PREFIX}"
```

Inspiration comes from this comment in a related boto issue, since the library itself has trouble with newer non-default regions: https://github.com/boto/boto/issues/2741

(I imagine this would be easier for us to program around if we were using the newer boto3 library instead (https://aws.amazon.com/sdk-for-python/), but this workaround might be useful in the meantime.)