cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know more about how you can find anything and protect everything? Check it out here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the c

Failed to establish a new connection: [WinError 10060] A connection attempt failed because the conne

JohnPT
Explorer | Level 3

Hi.  kind of stuck..  getting this error - worked two days ago. thanks for any ideas. 

 

Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'

 

same code works fine on test machine but fails on, production.   errors on the final print line.

 

with this code


import dropbox
filetoupload = 'Z:\\users\\aeadmin\\documents\\ysn1.png'

filetouploadname = '/ysn1d.png'

 

f= open(filetoupload,"rb")

 

dbx = dropbox.Dropbox(
app_key = "x65cwwc7.....",
app_secret = "3s809......",
oauth2_refresh_token = "IjYGZB7V...."
)

 

print(dbx.files_upload(f.read(),filetouploadname, mode=dropbox.files.WriteMode("overwrite")))

15 Replies 15

JohnPT
Explorer | Level 3

@Здравко 

 

Hi. sorry to pester... still having the same issues. 

 

i did a pip -upgrade (Successfully installed dropbox-11.36.0 cloud machine) and created new app with a refresh token.

same result - works fine on test (also did upgrade to 11.36.0) fails the same way in my cloud machine...  

 

going to try to figure out the During handling of the above exception, another exception occurred:

 

error :

 

Exception has occurred: ConnectionError
HTTPSConnectionPool(host='api.dropboxapi.com', port=443): Max retries exceeded with url: /oauth2/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001BBB8E9DFD0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

During handling of the above exception, another exception occurred:


During handling of the above exception, another exception occurred:


During handling of the above exception, another exception occurred:

File "Z:\users\........s\py-testupload.py", line 31, in <module>
print(dbx.files_upload(f.read(),filetouploadname, mode=dropbox.files.WriteMode("overwrite")))

 

any ideas?  

 

thank you for your thoughts.

Здравко
Legendary | Level 20

@JohnPT wrote:

...

Exception has occurred: ConnectionError
HTTPSConnectionPool(host='api.dropboxapi.com', port=443): Max retries exceeded with url: /oauth2/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001BBB8E9DFD0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

...


As I said, the refreshing process fails. The 'api.dropbox.com' is involved in this. Seems you didn't try to refresh by hand. Why? 🧐 Try ping the host, at least, and try query the server with alternative tool, all on the failing machine.

JohnPT
Explorer | Level 3

Thanks, sorry i was more focused on the PIP upgrade and creating a new app/refreshtoken.  thinking that the was the refresh you mention... 

 

i guess not understanding  "as I said, check the refresh process by hand sorry."  was thinking that was the upgrade.. and the accesstoken did work and the refreshtoken not might indicate something with the app.  

 

thanks for your patience.  how do i check the "refresh process"?  i thought that they never expired?

 

JohnPT
Explorer | Level 3

here is the ping

C:\Users\.....>ping api.dropbox.com

Pinging api-env.dropbox-dns.com [162.125.1.19] with 32 bytes of data:
Reply from 162.125.1.19: bytes=32 time=4ms TTL=55
Reply from 162.125.1.19: bytes=32 time=4ms TTL=55
Reply from 162.125.1.19: bytes=32 time=4ms TTL=55
Reply from 162.125.1.19: bytes=32 time=4ms TTL=55

Ping statistics for 162.125.1.19:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 4ms, Average = 4ms

Здравко
Legendary | Level 20

@JohnPT, Yes refresh token doesn't expire. It's used for periodical retrieve/refresh access token anew. This happens with specific request to Dropbox server (usually performed by SDK internally). That's something that fails. Let's see why. Take a look here about details on how OAuth works (including the refresh - last request). 'curl' is in use there; you can use whatever you want.

JohnPT
Explorer | Level 3

Thank you. will review. 

 

FWIW: i did test on another cloud (Azure) machine wondering if it might be an Azure/port thing...  

 

both apps (original and new ) worked fine with the refresh token.. so it must be something with the first machine.

not sure how to trace that...

I appreciate your help.

 

Need more support?