frappe: Offsite backup fails

Description of the issue

Backup fails to offsite location such as Google drive

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rq/worker.py", line 975, in perform_job
    rv = job.perform()
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rq/job.py", line 696, in perform
    self._result = self._execute()
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/rq/job.py", line 719, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 100, in execute_job
    method(**kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/google_drive/google_drive.py", line 187, in upload_system_backup_to_google_drive
    validate_file_size()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/offsite_backup_utils.py", line 88, in validate_file_size
    file_size = get_file_size(latest_file, unit="GB")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/offsite_backup_utils.py", line 74, in get_file_size
    file_size = os.path.getsize(file_path)
  File "/opt/bitnami/python/lib/python3.7/genericpath.py", line 50, in getsize
    return os.stat(filename).st_size
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Seems to be the same as this issue https://discuss.erpnext.com/t/backup-error-typeerror-stat-path-should-be-string-bytes-os-pathlike-or-integer-not-nonetype/66473

I’m using v13-beta6, however the backup was always working daily until a few days ago

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@deantheiceman It’s really just called “System Settings”, there you can set the number of backups. Then there is “backups”, from which you can trigger a manual backup. It will send you an email with a download link when it’s finished. I guess that’s most likely the step that might have fixed it.

Nonetheless, this really is a bug and should be addressed.

I got notifications about failed backups at least.

I am not sure what I did to solve it. I changed the number of backups in the system settings and then manually downloaded a backup. After that the S3 backup started working again…