Foswiki - S3 backup/restore (EU Zone).

Hi,

Only just noticed this because I needed a restore.
FOSWIKI 1.1.5 (but i have nasty idea that affects other JB's in below scenario)

I have an instance that was launched in the EU, but the AWS account it uses is by default set to US-EAST. the s3 gem this jumpbox uses is 0.4.0.

Amazon have for sometime suggested that the Fully qualified bucket name format should be <bucketname>.<amazon s3 domain>/ rather than <amazon s3 domain>/bucketname/
(i thinks that was one of the reasons that buckets could not end with . or - etc.)

Anyhow, the latter format (used by that gem) forces a http redirect in the above scenario and rightly you get the following error upon backup:

ast Backup Date: ERROR: /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/error.rb:38:in `raise': The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. (AWS::S3::PermanentRedirect) from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/base.rb:72:in `request' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/base.rb:83:in `get' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/bucket.rb:102:in `find' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/bucket.rb:145:in `objects' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/bucket.rb:314:in `reload!' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/../../../vendor/gems/aws-0.4.0/lib/aws/s3/bucket.rb:243:in `objects' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/backup.rb:189:in `get_last_backup_date' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/backup.rb:188:in `each' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/backup.rb:188:in `get_last_backup_date' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/utils.rb:176:in `send' from /jumpbox/application_portal/privileged_scripts/ubuntu/lib/utils.rb:176:in `execute_method' from /jumpbox/application_portal/privileged_scripts/ubuntu/app.rb:124

And backup thinks that none was ever taken.
Infact the tar does get stored in S3 and appears to be good.

Problem comes with restore, because of the redirects the admin UI never gets a list of the tar's in the bucket, so no restore from S3.
WORKAROUND: for me anyway is to download the relevant tar from S3 manually and then use JB admin local restore.

What I think needs to happen:
1. Updated gem (and ruby if possible).
2. or tweak the code to change the format of the bucket request as above (I may try this myself).

I am assuming here (without checking) that any other JB using that gem ver and buckets from a different zone than the instance is launched in will get this problem.

(I must admit i never had to restore a JB from S3 before, and infact have only recently started using S3 as backup - so i hope its not a big problem for me.)