Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Python
3 TopicsSlow response using Dropbox for Python
Hello, My python code has been working well for months. Within the past 48 hours, the files_download command in the snippet below (with tokens obfuscated) has started to take about 45 seconds while previously it was instantaneous. It is the last line that is the culprit. import dropbox DROPBOX_APP_KEY = "?????" DROPBOX_APP_SECRET = "?????" DROPBOX_REFRESH_TOKEN = "????" dbx = dropbox.Dropbox(app_key=DROPBOX_APP_KEY, app_secret=DROPBOX_APP_SECRET, oauth2_refresh_token=DROPBOX_REFRESH_TOKEN) metadata, f = dbx.files_download('/alerts.csv') Any suggestions? With thanks, David280Views0likes6CommentsAuthError 'invalid_access_token' with Python SDK after Token Refresh
Dear Dropbox Developer Team, I have been using the Dropbox API with your Python SDK for approximately four years without any issues. However, since November 25th or December 1st, I started encountering AuthError exceptions related to invalid access tokens. My implementation has remained unchanged during this time. I store tokens in a database and update them whenever the SDK retrieves a fresh one. Here is the relevant code snippet: After refreshing the access token using check_and_refresh_access_token(), subsequent requests (such as to files_list_folder or files_get_temporary_link) proceed without issue. However, when a new instance of DBXManager is created and the token is still valid (i.e., not expired and therefore not refreshed), requests may fail with the following error: dropbox.exceptions.AuthError: AuthError('a5dae06f271b404296dc9d254e75eb47', AuthError('invalid_access_token', None)) The only way to resolve this issue is to refresh the token again. As a temporary workaround, I am manually adjusting the token expiration in the database to force a refresh on the next instance creation. I am trying to understand the root cause of this behavior: Was there any recent change to the Dropbox backend or API behavior that could explain this issue? If this is a problem on my end, could you help clarify why the same implementation worked flawlessly for years? Thank you for your assistance. Please let me know if you need additional details about my setup or logs.Solved276Views0likes3CommentsAPI 'Connection Aborted' Error
Hello! I'm downloading files from an App Folder. I am downloading each one by one, totaling over 3000 files. I left the program to run and after 201 requests I got the error pasted below. I don't have a VPN or anything that would change my wifi connection as far as I know. Here is the code I am using: print("Initializing Dropbox API...") dbx = dropbox.Dropbox(AUTHORIZATION_TOKEN) topn = filenames[:len(filenames)] for val in topn: filepath = val #download a file to the local machine with open("/Users/<PATH>/dataimport.csv.gz", "wb") as f: metadata, res = dbx.files_download(path=filepath) f.write(res.content) print("download complete") The error: RemoteDisconnected Traceback (most recent call last) File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 788 # Make the request on the HTTPConnection object --> 789 response = self._make_request( 790 conn, 791 method, 792 url, 793 timeout=timeout_obj, 794 body=body, 795 headers=headers, 796 chunked=chunked, 797 retries=retries, 798 response_conn=response_conn, 799 preload_content=preload_content, 800 decode_content=decode_content, 801 **response_kw, 802 ) 804 # Everything went great! File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/connectionpool.py:536, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 535 try: --> 536 response = conn.getresponse() 537 except (BaseSSLError, OSError) as e: ... 684 except MaxRetryError as e: 685 if isinstance(e.reason, ConnectTimeoutError): 686 # TODO: Remove this in 3.0.0: see #2811 ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))259Views0likes1Comment