Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 681
oma Avatar asked Oct 30 '15 10:10

oma


2 Answers

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.

like image 177
Renaud Kern Avatar answered Nov 14 '22 08:11

Renaud Kern


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

like image 1
Luca Bruzzone Avatar answered Nov 14 '22 06:11

Luca Bruzzone