Erpnext dropox error

Dears

  • my old site name was erpnext.vm
  • i create a new site name erp.fastgrp.net
  • i transfer my old site To the new one and then i dropped the old site
  • i convert my site to work with a certificate
  • now i am trying to use dropox backup that was working well before make all those changes
  • Note : i added also Dropbox info in my site_config.json

Now it didn’t work and i got this error

===========================================

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 40, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 896, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 110, in get_dropbox_authorize_url
sess = doc.get_dropbox_session()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 57, in get_dropbox_session
raise_exception=False) if self.app_secret_key else frappe.conf.dropbox_secret_key
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 657, in get_password
return get_decrypted_password(self.doctype, self.name, fieldname, raise_exception=raise_exception)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/password.py”, line 16, in get_decrypted_password
return decrypt(auth[0][0])
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/password.py”, line 101, in decrypt
plain_text = cstr(cipher_suite.decrypt(encode(pwd)))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/fernet.py”, line 103, in decrypt
raise InvalidToken
InvalidToken

============================================

I believe this is an authentication problem. Are you sure you have copied the correct keys?

1 Like

i am sure because it was working before make all that changes
in addition i open my dropx setting in dropox site and copy it again

{
“db_name”: “",
“db_password”: "
",
“developer_mode”: 1,
“dropbox_access_key”: "
",
“dropbox_secret_key”: "
",
“encryption_key”: "
***************=”,
“host_name”: “http://erp.fastgrp.net”,
“limits”: {
“space_usage”: {
“backup_size”: 99.0,
“database_size”: 129.87,
“files_size”: 52.0,
“total”: 280.87
}
},
“scheduler_interval”: “900”,
“ssl_certificate”: “/etc/letsencrypt/live/erp.fastgrp.net/fullchain.pem”,
“ssl_certificate_key”: “/etc/letsencrypt/live/erp.fastgrp.net/privkey.pem”
}
~

@sheno,

The issue is with the encryption_key, please try to save the Dropbox Settings document again so that the app_access_key and app_secret_key will be saved using new encryption key

1 Like

Backup Upload Failed

Oops, your automated backup to Dropbox failed.

Error message:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 182, in take_backup_to_dropbox
did_not_upload, error_log = backup_to_dropbox()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 219, in backup_to_dropbox
dropbox_client = get_dropbox_client()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 249, in get_dropbox_client
token = dropbox_client.create_oauth2_access_token()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/client.py”, line 189, in create_oauth2_access_token
r = self.rest_client.POST(url, params, headers)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py”, line 322, in POST
return cls.IMPL.POST(*n, **kw)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py”, line 260, in POST
is_json_request=is_json_request)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py”, line 235, in request
raise ErrorResponse(r, r.read())
ErrorResponse: [401] u’Access token not found.’
Please contact your system manager for more information.

Any idea dears to fix this problem ?

@sheno

Have you allowed Dropbox Access from Dropbox Setting? Allow It and recheck.

1 Like

yea dear

and i am still get

error message to my email

================================

Backup Upload Failed

Oops, your automated backup to Dropbox failed.

Error message:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 182, in take_backup_to_dropbox
did_not_upload, error_log = backup_to_dropbox()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 219, in backup_to_dropbox
dropbox_client = get_dropbox_client()
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py”, line 249, in get_dropbox_client
token = dropbox_client.create_oauth2_access_token()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/client.py”, line 189, in create_oauth2_access_token
r = self.rest_client.POST(url, params, headers)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py”, line 322, in POST
return cls.IMPL.POST(*n, **kw)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py”, line 260, in POST
is_json_request=is_json_request)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dropbox/rest.py”, line 235, in request
raise ErrorResponse(r, r.read())
ErrorResponse: [401] u’Access token not found.’
Please contact your system manager for more information.

Check your dropbox keys, re-enter it.
Details - Setting Up Dropbox Backups

1 Like

i will check again and feed u back dear .

How you convert erpnext into certificate?

Dears

Finally it solved by adding the two following steps

bench restart
bench --site site1.local --force trigger-scheduler-event daily_long

Then i click agin on Allow access
and evey thing work well
thx alot dears

and thx also for
violetasdev

https://discuss.frappe.io/t/drop-box-backup-not-working/13857/5