jazzband / django-dbbackup

Management commands to help backup and restore your project database and media files
BSD 3-Clause "New" or "Revised" License
984 stars 219 forks source link

S3 seems to timeout if the backup takes a long time to create #12

Closed pkkid closed 9 years ago

pkkid commented 9 years ago
#!python

Traceback (most recent call last):
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/celery/execute/trace.py", line 47, in trace
   return cls(states.SUCCESS, retval=fun(*args, **kwargs))
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/celery/app/task/__init__.py", line 247, in __call__
   return self.run(*args, **kwargs)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/celery/app/__init__.py", line 175, in run
   return fun(*args, **kwargs)
 File "/home/user/www/staging/code_root/sam/../sam/core/tasks.py", line 14, in backup_database
   management.call_command('dbbackup', database='slave0')
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 166, in call_command
   return klass.execute(*args, **defaults)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
   output = self.handle(*args, **options)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/dbbackup/utils.py", line 50, in wrapper
   func(*args, **kwargs)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/dbbackup/management/commands/dbbackup.py", line 41, in handle
   self.save_new_backup(database)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/dbbackup/management/commands/dbbackup.py", line 54, in save_new_backup
   self.storage.write_file(backupfile)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/dbbackup/storage/s3_storage.py", line 59, in write_file
   self.bucket.put_file(filepath, filehandle)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/simples3/streaming.py", line 68, in put_file
   headers=headers)
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/simples3/bucket.py", line 246, in put
   self.make_request("PUT", key=key, data=data, headers=headers).close()
 File "/home/user/www/staging/env/local/lib/python2.7/site-packages/simples3/bucket.py", line 212, in make_request
   raise exc_cls.from_urllib(e, key=key)
S3Error: Your socket connection to the server was not read from or written to within the timeout period.

pkkid commented 9 years ago

Meant to create this on my fork...


Original comment by: Tobias McNulty

pkkid commented 9 years ago

fix for this here: https://bitbucket.org/mjs7231/django-dbbackup/pull-request/3/fix-for-s3-timeout-error-issue-5


Original comment by: Tobias McNulty

pkkid commented 9 years ago

Merged -- I think this one was causing issues for celery as well. The fix you implemented never occurred to me. Thanks a lot.


Original comment by: Michael Shepanski