Ruby Backup gem failing when uploading to S3. connection reset after 37 min
Asked Answered
G

2

9

The backups are 250MB. I don't think that's very big, but it appears the problem is increasing with the size.

Log from the Backup gem below.

Note the time span; about 37 min into the uploading I get connection reset.

[2015/10/30 09:20:40][message] Storage::S3 started transferring '2015.10.30.09.20.01.myapp_postgres.tar' to bucket 'myapp-backups'.
[2015/10/30 09:57:06][error]   ModelError: Backup for Back up PostgreSQL (myapp_postgres) Failed!
[2015/10/30 09:57:06][error]   An Error occured which has caused this Backup to abort before completion.
[2015/10/30 09:57:06][error]   Reason: Excon::Errors::SocketError
[2015/10/30 09:57:06][error]   Connection reset by peer
Granddaughter answered 30/10, 2015 at 10:32 Comment(2)
Does this happen after 37 min each time?Valerivaleria
no, it varies. it doesn't even happen all the time, but sporadically more oftenGranddaughter
H
4

Did you try the error handing options, which retransmit the file's portions that have failed :

store_with S3 do |s3|
  s3.max_retries = 10
  s3.retry_waitsec = 30
end

Keep also the chunk size small:

store_with S3 do |s3|
  s3.chunk_size = 5 # MiB
end

You may also want to use the Splitter options.

Haha answered 7/11, 2015 at 10:43 Comment(6)
I've got tests out now with the retry options. I had also set chunk size 4000, think it was a count, not a size metric.Granddaughter
NoMethodError: undefined method `max_retries=' for #<Backup::Storage::S3:0x007f9c7c6f58e0>Granddaughter
Which backup gem version do you have?Haha
I need to work more on it, updating etc and I'm too busy right now (what a cliche). Giving you the bounty Renaud, but won't accept any answer until proven, so I don't mislead anybody. Thanks for trying to help :)Granddaughter
Renaud, I had to fight alot with chef, throwing knifes and cookbooks around. I'm not a master-chef to be honest :D Finally I got backup gem upgraded. Preliminary results are very positive, I'll keep monitoring and update here for other readers' interests too.Granddaughter
Thanks oma for your feedback.Haha
B
1

I wuold say for now to use ruby-xz to compress in a smaller file in order to send it more compressed and temprary patch it, then try to see

Excon.defaults[:write_timeout] = 500

or more would do the trick

Boudoir answered 8/11, 2015 at 20:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.