Dropbox Backup Error on ERPNext Frappe

Title:
frappe.integrations.doctype.dropbox_settings.dropbox_settings.take_backup_to_dropbox

Error

Traceback (most recent call last):
File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 76, in take_backup_to_dropbox
did_not_upload, error_log = backup_to_dropbox(upload_db_backup)
File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 135, in backup_to_dropbox
upload_file_to_dropbox(filename, “/database”, dropbox_client)
File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 208, in upload_file_to_dropbox
create_folder_if_not_exists(folder, dropbox_client)
File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 246, in create_folder_if_not_exists
dropbox_client.files_get_metadata(folder)
File “env/lib/python3.7/site-packages/dropbox/base.py”, line 1512, in files_get_metadata
None,
File “env/lib/python3.7/site-packages/dropbox/dropbox_client.py”, line 327, in request
timeout=timeout)
File “env/lib/python3.7/site-packages/dropbox/dropbox_client.py”, line 482, in request_json_string_with_retry
timeout=timeout)
File “env/lib/python3.7/site-packages/dropbox/dropbox_client.py”, line 600, in request_json_string
raise BadInputError(request_id, r.text)
dropbox.exceptions.BadInputError: BadInputError(‘8a3438543c2b4de2b983d6c502d218ff’, ‘Error in call to API function “files/get_metadata”: Your app is not permitted to access this endpoint because it does not have the required scope 'files.metadata.read'. The owner of the app can enable the scope for the app using the Permissions tab on the App Console.’)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/utils/background_jobs.py”, line 147, in execute_job
retval = method(**kwargs)
File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 101, in take_backup_to_dropbox
send_email(False, “Dropbox”, “Dropbox Settings”, “send_notifications_to”, error_message)
File “apps/frappe/frappe/integrations/offsite_backup_utils.py”, line 43, in send_email
frappe.sendmail(recipients=recipients, subject=subject, message=message)
File “apps/frappe/frappe/init.py”, line 693, in sendmail
with_container=with_container,
File “apps/frappe/frappe/email/queue.py”, line 118, in send
email_account = get_outgoing_email_account(True, append_to=reference_doctype, sender=sender)
File “apps/frappe/frappe/email/smtp.py”, line 107, in get_outgoing_email_account
frappe.OutgoingEmailError,
File “apps/frappe/frappe/init.py”, line 511, in throw
as_list=as_list,
File “apps/frappe/frappe/init.py”, line 479, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 434, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.OutgoingEmailError: Please setup default Email Account from Setup > Email > Email Account

Hy @Khizar

Check your email account is configured.

I tried setting it up. now getting the following…

Title
pull_from_email_account

Error

Traceback (most recent call last):
File “/usr/lib/python3.7/imaplib.py”, line 1019, in _command_complete
typ, data = self._get_tagged_response(tag)
File “/usr/lib/python3.7/imaplib.py”, line 1139, in _get_tagged_response
self._get_response()
File “/usr/lib/python3.7/imaplib.py”, line 1047, in _get_response
resp = self._get_line()
File “/usr/lib/python3.7/imaplib.py”, line 1149, in _get_line
line = self.readline()
File “/usr/lib/python3.7/imaplib.py”, line 312, in readline
raise self.error(“got more than %d bytes” % _MAXLINE)
imaplib.IMAP4.error: got more than 20480 bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/email/receive.py”, line 154, in get_messages
uid_list = email_list = self.get_new_mails()
File “apps/frappe/frappe/email/receive.py”, line 218, in get_new_mails
response, message = self.imap.uid(“search”, None, self.settings.email_sync_rule)
File “/usr/lib/python3.7/imaplib.py”, line 879, in uid
typ, dat = self._simple_command(name, command, *args)
File “/usr/lib/python3.7/imaplib.py”, line 1196, in _simple_command
return self._command_complete(name, self._command(name, *args))
File “/usr/lib/python3.7/imaplib.py”, line 1023, in _command_complete
raise self.error(‘command: %s => %s’ % (name, val))
imaplib.IMAP4.error: command: UID => got more than 20480 bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/utils/background_jobs.py”, line 147, in execute_job
retval = method(**kwargs)
File “apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 971, in pull_from_email_account
email_account.receive()
File “apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 352, in receive
emails = email_server.get_messages()
File “apps/frappe/frappe/email/receive.py”, line 188, in get_messages
if self.has_login_limit_exceeded(e):
File “apps/frappe/frappe/email/receive.py”, line 334, in has_login_limit_exceeded
return “-ERR Exceeded the login limit” in strip(cstr(e.message))
AttributeError: ‘error’ object has no attribute ‘message’

Finally received email.

Backup Upload Failed!

Oops, your automated backup to Dropbox failed.

Error message: Traceback (most recent call last): File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 76, in take_backup_to_dropbox did_not_upload, error_log = backup_to_dropbox(upload_db_backup) File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 135, in backup_to_dropbox upload_file_to_dropbox(filename, “/database”, dropbox_client) File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 208, in upload_file_to_dropbox create_folder_if_not_exists(folder, dropbox_client) File “apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 246, in create_folder_if_not_exists dropbox_client.files_get_metadata(folder) File “env/lib/python3.7/site-packages/dropbox/base.py”, line 1512, in files_get_metadata None, File “env/lib/python3.7/site-packages/dropbox/dropbox_client.py”, line 327, in request timeout=timeout) File “env/lib/python3.7/site-packages/dropbox/dropbox_client.py”, line 482, in request_json_string_with_retry timeout=timeout) File “env/lib/python3.7/site-packages/dropbox/dropbox_client.py”, line 600, in request_json_string raise BadInputError(request_id, r.text) dropbox.exceptions.BadInputError: BadInputError(‘4ce639a238a6401e96284dd1bda12d33’, ‘Error in call to API function “files/get_metadata”: Your app is not permitted to access this endpoint because it does not have the required scope 'files.metadata.read'. The owner of the app can enable the scope for the app using the Permissions tab on the App Console.’)

Please contact your system manager for more information.