sukria / Backup-Manager

Versatile yet easy to use command line backup tool for GNU/Linux. Suitable for desktop and servers.
http://www.backup-manager.org/
GNU General Public License v2.0
277 stars 88 forks source link

Error when trying to upload to s3 #94

Open alxckn opened 7 years ago

alxckn commented 7 years ago

Hello,

I'm trying to upload backups to s3 and I'm facing this error:

Using the upload method "S3".
Trying to upload files to s3 service
Connected to s3.amazon.com
Bucket backup does not exist... creating
opened /var/archives/index-20170125-1 of length 559 and will name the key index-20170125-1
Error reported by backup-manager-upload for method "s3", check "/tmp/bmu-log.oj0ULo".
Releasing lock
foo@foo:~$ sudo cat /tmp/bmu-log.oj0ULo 
Could not create bucket backup
Can't locate object method "add_key_filename" via package "0" (perhaps you forgot to load "0"?) at //usr/local/bin/backup-manager-upload line 930.

Is this a bug or am I missing something in my configuration? Thank you,

Alex

mmihalev commented 7 years ago

I have exactly the same problem on Centos 7

alxckn commented 7 years ago

@mmihalev I created a cronjob to upload backed up files every day right after backup-manager's run has finished, using aws cli:

15 2 * * * /usr/local/bin/aws s3 sync /var/archives s3://<bucket-name>/archives >> /var/log/aws_s3.log

Hope that helps ;)

mmihalev commented 7 years ago

@alxckn how do you know when backup-manager is done with the archives?

mmihalev commented 7 years ago

I think export BM_POST_BACKUP_COMMAND="/usr/bin/aws s3 sync /backups s3://bucket" will do the job

alxckn commented 7 years ago

Even better

fezeev commented 7 years ago

Just now faced this problem and remember, that I already resolved it some time ago. I don't remember, what exactly was the reason, but the final point was changing the bucket region. Region "Europe Ireland" faced this problem. Region "US East (N. Virginia)" don't.

alexisattimont commented 7 years ago

I've met this problem too. @fezeev is right, but the easiest way to do that is to not create the bucket previously and let backup-manager to create it (simply set a name which doesn't already exist in your buckets).

jcfjcosta commented 7 years ago

Hi, this is linked with the perl package Net::Amazon::S3. Most probably this: https://github.com/rustyconover/net-amazon-s3/issues/19

Buckets in AWS Europe use signature v4. Also may be related with the absence of host.

sprnegr commented 4 years ago

I got same issues when try use BM_UPLOAD_S3_DESTINATION param with '-' in bucket name. Everything works after assigning a different bucket name.