WebexCommunity / WebexPythonSDK

Work with the Webex APIs in native Python!
https://webexcommunity.github.io/WebexPythonSDK/
MIT License
239 stars 153 forks source link

connection aborted #101

Closed matthewf01 closed 4 years ago

matthewf01 commented 4 years ago

If I run a api.people.get command on a loop once per minute, I am occassionally (though very infrequently) seeing it bomb out with this returned:

Traceback (most recent call last): File "webexteams.py", line 35, in status = api.people.get(personId=matthew_id).status File "/usr/local/lib/python2.7/dist-packages/webexteamssdk/api/people.py", line 208, in get json_data = self._session.get(API_ENDPOINT + '/' + personId) File "/usr/local/lib/python2.7/dist-packages/webexteamssdk/restsession.py", line 292, in get response = self.request('GET', url, erc, params=params, kwargs) File "/usr/local/lib/python2.7/dist-packages/webexteamssdk/restsession.py", line 253, in request response = self._req_session.request(method, abs_url, kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send r = adapter.send(request, kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 473, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))

I'm unsure if perhaps this is due to the API not returning any information about WHY it aborted?

My script is available to reference here: https://github.com/matthewf01/Webex-Teams-Status-Box/blob/master/webexteams.py

cmlccie commented 4 years ago

Hi @matthewf01. A ConnectionError from requests indicates that the code was unable to establish an HTTP connection with the remote host (in this api.ciscospark.com). No data will be returned by the remote host since the connection could not complete.