The last few weeks I've been getting connection timeout issues more and more often. I am using the Dropbox Python API version 2.2.0 with Python 2.7.11.
For instance, I received this error when downloading a file that is only 473 KB large:
ConnectTimeoutError at /my_company/file/download.pdf (<urllib3.connectionpool.VerifiedHTTPSConnection instance at 0x7f4eaa950950>, ‘Connection to api-content.dropbox.com timed out. (connect timeout=60.0)’)
Here's the code that is being run inside of the view:
response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = 'attachment; filename="preview.pdf"'
client = dropbox.client.DropboxClient('my_token')
with client.get_file(path) as f:
response.write(f.read())
return response
Pretty basic stuff. Just downloading the file and rendering it to the response. Yet this resulted in a connection timeout error. Any ideas why?