OneDrive / onedrive-sdk-python

OneDrive SDK for Python! https://dev.onedrive.com
MIT License
1.08k stars 189 forks source link

Connection refused when upload_async() #177

Closed KTibow closed 3 weeks ago

KTibow commented 4 years ago

This is the traceback:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 301, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0xb1804cf0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.onedrive.com', port=443): Max retries exceeded with url: /rup/164bf6b70043f25b/eyJSZXNvdXJjZUlEIjoiMTY0QkY2QjcwMDQzRjI1QiExMDMiLCJSZWxhdGlvbnNoaXBOYW1lIjoiYmFja3VwLnppcCJ9/4moWVgN8rXVwlBWoSpz9lXuC-62Xa7SCL8_Hbo2AxZXqJ7haIfurNbL-isjAGs2Q9d9PDKVuikE87V6IuuPkr9b9dKUjiibox2yA0qmbFw5Cs/eyJuYW1lIjoiYmFja3VwLnppcCIsIkBuYW1lLmNvbmZsaWN0QmVoYXZpb3IiOiJyZXBsYWNlIn0/4w2Mfwmnv2tkZPr074rPavmwdtsx9ruSGB0ECE5zyeG_LtOd-w5myhLHXRhfFzP-_XxTnVfqqnbGL_ktwy-PRhUEs4RC7Oae1betlRWAMLXuPzRaVOzc-sHAmVNz2uOv9OSUhjuq3YiTYkD31ZgQ8RWrmQXIxotu4n_s0tYp4R09ahY7JCmcdjz3uImNBCdJAPvOJFReBROXhqbLc4cahQkouelUwcoGknyaRK-LB588YGquPPzjHbxTmAHnh6nWVYBr6QwIp3r6jTCIHEdwMmdsw3Tsgb9R46W1pUCOn8AGayEU65s3i7Gnp-P9BX8YAxy5mozwVSGeCrCKTJs4ewJNKuOPJupw_2nossDXfXOpdytAt2b6Yv7iKtSejX-ee0-D5FB5v-fhcJ_E7SmOCkYGGnhCg3ZRvy8piOxlrLnGrZ7fAN1iKPV6RPJhcGU4FVvlAm-4Z9_Hu18sx5Iln33d9g-9K_mFbY-D4cJAU_AhFvP9jmWledLX4DQ4DFhyZSsd0DE6FQNzTP4xNA5yZMzrbL67SbZ2l2ZTXnVPmSrHhn2egzLO1Yj3gjEghFVduAgwlfBy5tH_rtvll9o9BAH7v1sLIH3k5IJgqGNdf9X5Q (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb1804cf0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/backup.py", line 191, in <module>
    client.item(drive='me', path="backup.zip").upload_asynThis may be a c('/root/backup.zip', upload_status=status)
  File "/usr/local/lib/python3.7/dist-packages/onedrivesdk/version_bridge/fragment_upload.py", line 173, in fragment_upload_async
    resp = upload_builder.post(i * __PART_SIZE, length)
  File "/usr/local/lib/python3.7/dist-packages/onedrivesdk/version_bridge/fragment_upload.py", line 121, in post
    return self.request(begin, length, options).post()
  File "/usr/local/lib/python3.7/dist-packages/onedrivesdk/version_bridge/fragment_upload.py", line 57, in post
    entity = UploadSession(json.loads(self.send(data=self._file_handle).content))
  File "/usr/local/lib/python3.7/dist-packages/onedrivesdk/request_base.py", line 151, in send
    data=data)
  File "/usr/local/lib/python3.7/dist-packages/onedrivesdk/http_provider.py", line 69, in send
    response = session.send(prepped)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.onedrive.com', port=443): Max retries exceeded with url: /rup/164bf6b70043f25b/eyJSZXNvdXJjZUlEIjoiMTY0QkY2QjcwMDQzRjI1QiExMDMiLCJSZWxhdGlvbnNoaXBOYW1lIjoiYmFja3VwLnppcCJ9/4moWVgN8rXVwlBWoSpz9lXuC-62Xa7SCL8_Hbo2AxZXqJ7haIfurNbL-isjAGs2Q9d9PDKVuikE87V6IuuPkr9b9dKUjiibox2yA0qmbFw5Cs/eyJuYW1lIjoiYmFja3VwLnppcCIsIkBuYW1lLmNvbmZsaWN0QmVoYXZpb3IiOiJyZXBsYWNlIn0/4w2Mfwmnv2tkZPr074rPavmwdtsx9ruSGB0ECE5zyeG_LtOd-w5myhLHXRhfFzP-_XxTnVfqqnbGL_ktwy-PRhUEs4RC7Oae1betlRWAMLXuPzRaVOzc-sHAmVNz2uOv9OSUhjuq3YiTYkD31ZgQ8RWrmQXIxotu4n_s0tYp4R09ahY7JCmcdjz3uImNBCdJAPvOJFReBROXhqbLc4cahQkouelUwcoGknyaRK-LB588YGquPPzjHbxTmAHnh6nWVYBr6QwIp3r6jTCIHEdwMmdsw3Tsgb9R46W1pUCOn8AGayEU65s3i7Gnp-P9BX8YAxy5mozwVSGeCrCKTJs4ewJNKuOPJupw_2nossDXfXOpdytAt2b6Yv7iKtSejX-ee0-D5FB5v-fhcJ_E7SmOCkYGGnhCg3ZRvy8piOxlrLnGrZ7fAN1iKPV6RPJhcGU4FVvlAm-4Z9_Hu18sx5Iln33d9g-9K_mFbY-D4cJAU_AhFvP9jmWledLX4DQ4DFhyZSsd0DE6FQNzTP4xNA5yZMzrbL67SbZ2l2ZTXnVPmSrHhn2egzLO1Yj3gjEghFVduAgwlfBy5tH_rtvll9o9BAH7v1sLIH3k5IJgqGNdf9X5Q (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb1804cf0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Does anybody know the cause of this, or how to fix this?

enhee2706 commented 3 years ago

Me too i have this problem.

KTibow commented 3 years ago

@enhee2706 you might be able to try the other upload method in the meantime.

baywet commented 3 weeks ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #209 for more information