Hi there,
I am using Amazon S3 to back up my Rails app's mysql database. And I am using astrails-safe plugin to do that and I got the "Your previous request to create the named bucket succeeded and you already own it. (AWS::S3::BucketAlreadyOwnedByYou)" error back whenever I try to update it.
I have checked that the folder in which I am going to back up is there in my account already. It's just that I can't upload the files from the code (using astrails-safe).
ok. When I run this code
sudo astrails-safe /Users/pww/sites/web_apps/myapp/trunk/lib/backup/local.rb
, I got the following error.
/opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/error.rb:38:in `raise': Your previous request to create the named bucket succeeded and you already own it. (AWS::S3::BucketAlreadyOwnedByYou)
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:72:in `request'
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:88:in `put'
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:79:in `create'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/s3.rb:29:in `save'
from /opt/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/s3.rb:28:in `save'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/sink.rb:8:in `process'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/backup.rb:15:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/backup.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/backup.rb:12:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:53:in `safe'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/config/node.rb:51:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe/config/node.rb:51:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:52:in `safe'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:46:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/lib/astrails/safe.rb:46:in `safe'
from /Users/phyowaiwin/sites/web_apps/myapp/trunk/lib/backup/local.rb:1
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/bin/astrails-safe:50:in `load'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/bin/astrails-safe:50:in `main'
from /opt/local/lib/ruby/gems/1.8/gems/astrails-safe-0.2.7/bin/astrails-safe:53
from /opt/local/bin/astrails-safe:19:in `load'
from /opt/local/bin/astrails-safe:19
The code in local.rb is as follow.
safe do
local do
path "/backup/:kind"
end
s3 do
key "mykey"
secret "mysecret"
bucket "myapp-local-backup"
path ":kind/:id" # this is default
end
keep do
local 100
s3 100
mysqldump 100
end
# backup mysql databases with mysqldump
mysqldump do
# you can override any setting from parent in a child:
options "-ceKq --single-transaction --create-options"
user "root"
password ""
# host "localhost"
# port 3306
socket "/tmp/mysql.sock"
database :myapp_development
end
tar do
options "-h" # uncomment this to dereference symbolic links
archive "myapp-local-com" do
files "~/sites/web_apps/myapp/branches"
end
end
end
Any help would be appreciated!
Thanks.