We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

JohnPT's avatar
JohnPT
Explorer | Level 3
2 years ago

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

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")))

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    JohnPT, some more info might be helpful. Your Python SDK single method call involves 2 API calls (on 2 different Dropbox servers)! It's not clear least which one fails. Some stacktrace would be fine. Does the same happen if you perform client object initialization with access token, instead of refresh token? Check that, if possible, on the machine where execution fails.

    • JohnPT's avatar
      JohnPT
      Explorer | Level 3

      Здравко 

       

      It fails on the final line the upload request.  >  print(dbx.files_upload(f.read(),filetouploadname, mode=dropbox.files.WriteMode("overwrite")))

      I get a dbx object that looks fine in vscode.

       

      I will try this. working to get trace and try on another machine.   i am testing on windows 10 machine for test and prod.

       

      Thank you for your help.

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        JohnPT wrote:

        ...

        It fails on the final line the upload request.  >  print(dbx.files_upload(f.read(),filetouploadname, mode=dropbox.files.WriteMode("overwrite")))

        I get a dbx object that looks fine in vscode.

        ...


        Just to add some clarification. Yes, for sure the code, you posted, is the only place where things can get wrong. It's the only place, in your code, where API calls get performed. The 'dbx' object itself can look fine after construction. Construction doesn't perform too much checks! You can construct Dropbox client object with completely wrong parameters and it will looks "fine". It wont look the same when you're going to execute some of its method though (where the actual mistakes get up). 😉

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

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 or Facebook.

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!