Google Drive Backup / Calendar Break on Restore

My Google Drive and Calendar were working fine before I backed up and restored the fresh V12 system. I have tried deleting the Google settings, reinstalling each setting, performing bench migrate and reboots but have been unsuccessful getting the Google backup and calendar integrations to work again. Has anyone experienced this type of error or have an idea how to fix it?

This is the error in the log:

Queue / Worker Job Created
failed
frappe.integrations.doctype.google_drive.google_drive.upload_system_backup_to_google_drive

Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/worker.py”, line 793, in perform_job
rv = job.perform()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 599, in perform
self._result = self._execute()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 605, in _execute
return self.func(self.args, **self.kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 102, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/google_drive/google_drive.py”, line 188, in upload_system_backup_to_google_drive
validate_file_size()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/offsite_backup_utils.py”, line 79, in validate_file_size
latest_file = get_latest_backup_file()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/offsite_backup_utils.py”, line 52, in get_latest_backup_file
latest_file = get_latest('
.sql.gz’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/offsite_backup_utils.py”, line 50, in get_latest
return max(file_list, key=os.path.getctime)
ValueError: max() arg is an empty sequence

07-07-2020 21:19:27

Started Queued Failed Finished

Last refreshed 2020-07-07 21:20:58

I seemed to have solved the problem.

Here are some tips for other people trying to set up Google:

  • After you authorize the Google Calendar or Google Drive service, be sure to “Save” before you exit the ERPNext screen.
  • Set up the services using a user account, not the Administrator
  • When setting up your site and callback URI credentials in the Google developer console, be mindful of using http vs https if you are not using an encrypted site.
  • If you copy and past your Client ID into the ERPNext form, it may add extra spaces to the beginning of the ID. Make sure you delete the spaces or you will have heartburn authroizing.
2 Likes