Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
rgfpy
8 years agoNew member | Level 2
Python API Error Upload SSL
Tengo el siguiente error cuando intento hacer upload de un archivo utilizando el ejemplo de github example/back-up-and-restore/backup-and-restore-example.py archivos pequeños de 10Mb lo sube sin problemas pero uno de 20Mb ya salta el error
Versiones utilizadas en Windows 10 Pro x64 y Windows Server 2008R2:
python:3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] dropbox:9.0.0 requests:2.19.1 six:1.11.0
Traceback (most recent call last):
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1055, in _send_output
self.send(chunk)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 977, in send
self.sock.sendall(data)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1012, in sendall
v = self.send(byte_view[count:])
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 981, in send
return self._sslobj.write(data)
ssl.SSLWantWriteError: The operation did not complete (write) (_ssl.c:2317)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 445, in send
timeout=timeout
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='content.dropboxapi.com', port=443): Max retries exceeded with url: /2/files/upload (Caused by SSLError(SSLWantWriteError(3, 'The operation did not complete (write) (_ssl.c:2317)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\upload-dropbox.py", line 105, in <module>
uploadDropbox()
File ".\upload-dropbox.py", line 30, in uploadDropbox
dbx.files_upload(f.read(), BACKUPPATH, mode=WriteMode('overwrite'))
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\dropbox\base.py", line 2207, in files_upload
f,
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\dropbox\dropbox.py", line 274, in request
timeout=timeout)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\dropbox\dropbox.py", line 365, in request_json_string_with_retry
timeout=timeout)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\dropbox\dropbox.py", line 449, in request_json_string
timeout=timeout,
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 559, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 511, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='content.dropboxapi.com', port=443): Max retries exceeded with url: /2/files/upload (Caused by SSLError(SSLWantWriteError(3, 'The operation did not complete (write) (_ssl.c:2317)')))5 Replies
- rgfpy8 years agoNew member | Level 2
Editando el archivo C:\Users\rgfpy\AppData\Local\Programs\Python\Python37\lib\site-packages\dropbox\dropbox.py en la línea 129 la variable _DEFAULT_TIMEOUT que por default esta 30 segundos si aumento a más logra subir archivos de más tamaños pero un archivo de 200Mb o mas no sube
- Greg-DB8 years ago
Dropbox Community Moderator
Gracias por el informe! Esto parece ser un problema cuando se utiliza el SDK de Dropbox Python con Python 3. Estamos investigando.
Como solución temporal, intente establecer un tiempo de espera ilimitado al construir su cliente de Dropbox, así:
dropbox.Dropbox(TOKEN, timeout=None)
---
Disculpe nuestras traducciones Nuestras traducciones fueron creadas usando un traductor en línea. Nos gustaría apoyar todos los idiomas, pero actualmente no estamos equipados para hacerlo. Aquí está la versión en inglés:
---
Please excuse our translations. Our translations were created using an online translator. We'd like to support every language, but we're not currently equipped to do so. Here is the English version:
---
Thanks for the report! This appears to be an issue when using the Dropbox Python SDK with Python 3. We're looking into it.
As a workaround, please try setting an unlimited timeout when constructing your Dropbox client, like this:
dropbox.Dropbox(TOKEN, timeout=None)
- leojtonozzi3 years agoNew member | Level 2
Hello, I am having the exact same issue.
Unfortunately your proposed fix did not fix the issue. Are there any updates to this?
Thank you. - leojtonozzi3 years agoNew member | Level 2
Turns out this was an error on my end in the Python script. I believe it was from initializing the token multiple times, however, I am unsure exactly what caused the issue.
https://stackoverflow.com/questions/23894221/upload-file-to-my-dropbox-from-python-script I used the structure of the code found in the first answer here.
- Здравко3 years agoLegendary | Level 20
Hi leojtonozzi,
Recent versions support Python 3 already, so neither your issue nor the solution can be the same. You can try describe what exactly you are receiving to becomes a bit more clear what's wrong.
Something else: The thread you're looking on is pretty old! There are described practices that are deprecated already (long lived access token). The old tokens, if you have one, still work, but if you haven't such, forget what you have read. Find something newer...
Good luck.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!