HTTPError: 400 Client Error: Bad Request for url: https://api.dropboxapi.com/2/auth/token/from_oauth1

Since June 29 these errors started to appear in the error log:

Traceback (most recent call last):
  File "/home/frappe/benches/bench-2017-06-28/apps/frappe/frappe/integrations/utils.py", line 40, in make_post_request
    frappe.flags.integration_request.raise_for_status()
  File "/home/frappe/benches/bench-2017-06-28/env/lib/python2.7/site-packages/requests/models.py", line 937, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 400 Client Error: Bad Request for url: https://api.dropboxapi.com/2/auth/token/from_oauth1

Does this have something to do with Dropbox API v1 deprecation?

Environment:
official SaaS account
ERPNext: v8.2.2 (master)
ERPNext Shopify: v2.0.10 (master)
Frappe Framework: v8.2.3 (master)

Yes, we have already moved to version 2. I think you have to re-authenticate.

@saurabh6790 can you please confirm?

I assume that to re-authenticate we should have Dropbox account, is it correct? We don’t have any account on Dropbox and don’t use this integration, so I just disabled it.

@strixaluco We have moved to dropbox V2 api.

Also, we have fixed the above issue. [minor][fix] check for oauth1 access_key and access_secret before generating dropbox's oauth2 token by saurabh6790 · Pull Request #3593 · frappe/frappe · GitHub

1 Like

Thank you for fast fix. Will check back and report once this commit lands to master.

Still having the same tracebacks daily with one part changed — bench-2017-06-28 now is bench-2017-07-01

Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py", line 45, in take_backup_to_dropbox
    did_not_upload, error_log = backup_to_dropbox()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py", line 86, in backup_to_dropbox
    access_token = generate_oauth2_access_token_from_oauth1_token(dropbox_settings)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py", line 283, in generate_oauth2_access_token_from_oauth1_token
    return make_post_request(url, auth=auth, headers=headers, data=json.dumps(data))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/integrations/utils.py", line 48, in make_post_request
    raise exc
HTTPError: 400 Client Error: Bad Request for url: https://api.dropboxapi.com/2/auth/token/from_oauth1

Today traceback changed:

Traceback (most recent call last):
File "/home/frappe/benches/bench-2017-07-06/apps/frappe/frappe/integrations/doctype/dropbox_settings/dropbox_settings.py", line 45, in take_backup_to_dropbox
did_not_upload, error_log = backup_to_dropbox()
TypeError: 'NoneType' object is not iterable