diff --git a/readthedocs/builds/syncers.py b/readthedocs/builds/syncers.py index 7291bade16f..f0b20b16855 100644 --- a/readthedocs/builds/syncers.py +++ b/readthedocs/builds/syncers.py @@ -213,13 +213,16 @@ def copy(cls, path, target, host, is_file=False, **kwargs): # pylint: disable=a any([target.lower().endswith(ext) for ext in cls.extensions]): log.info('Selective Copy %s to media storage', target) - storage_path = cls.get_storage_path(target) + try: + storage_path = cls.get_storage_path(target) - if storage.exists(storage_path): - storage.delete(storage_path) + if storage.exists(storage_path): + storage.delete(storage_path) - with open(target, 'rb') as fd: - storage.save(storage_path, fd) + with open(target, 'rb') as fd: + storage.save(storage_path, fd) + except Exception: + log.exception('Storage access failed for file. Not failing build.') class Syncer(SettingsOverrideObject):