Duplicity not writing to a pre-existing S3 bucket

amazon s3backupduplicity

I'm trying to backup a directory to a pre-existing Amazon S3 bucket using the following command:

duplicity --no-encryption system/ s3+http://MY_BUCKET_NAME/backup

However, I'm getting the following error consistently:

S3CreateError: S3CreateError: 409 Conflict
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>BucketAlreadyOwnedByYou</Code><Message>Your previous request to create the named bucket succeeded and you already own it.</Message><BucketName>vacationlabs</BucketName><RequestId>3C1B8C49469E3374</RequestId><HostId>4dU1TKf3Td6R0yvG9MaLKCYvQfwaCpdM8FUcv53aIOh0LeJ6wtVHHduPSTqjDwt0</HostId></Error>
  1. The S3 bucket is empty and does NOT have the backup directory
  2. The bucket is in Singapore region

Best Answer

Duplicity also supports Amazon S3 URLs in this format:

s3://host/bucket_name[/prefix]

where host is the S3 endpoint for your region, which you can find in Amazon's list of endpoints.

In your case, the URL you want is:

s3://s3-ap-southeast-1.amazonaws.com/MY_BUCKET_NAME/backup

Note that:

  • Duplicity can still only create buckets in the US Standard and EU regions, which means you'll need to manually create the bucket (which you already have).

  • For regions other than US Standard, you will want to have Duplicity use Amazon's "new style" subdomain bucket addressing, by adding --s3-use-new-style to your Duplicity command line.