opentok / Opentok-Python-SDK

OpenTok Python SDK
https://tokbox.com/developer/sdks/python/
MIT License
73 stars 83 forks source link

xml.parsers.expat.ExpatError error during create_session() #120

Closed jenstroeger closed 6 years ago

jenstroeger commented 6 years ago

I recently stumbled upon the following exception:

Traceback (most recent call last):
  File "/var/www/…/lib64/python3.6/site-packages/opentok/opentok.py", line 273, in create_session
    dom = xmldom.parseString(response.content)
  File "/usr/lib64/python3.6/xml/dom/minidom.py", line 1968, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 925, in parseString
    return builder.parseString(string)
  File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0

which was triggered by this call on our server:

tokbox_session = _tokbox_sdk.create_session(media_mode=MediaModes.routed)

This is the first time that I have seen this happening, and I haven’t seen it for a week now. Any recommendations on how to proceed?

aiham commented 6 years ago

@jenstroeger This may have happened when our API server was down and returning invalid responses to the create session request, causing the server SDK to fail when parsing what it expected to be XML.

Did this happen on February 15th? We had an outage then: https://status.tokbox.com/incidents/kkfkg4x3g495

jenstroeger commented 6 years ago

Thanks @aiham! Indeed, the request failed at 2018-02-16 02:26:45.675995+00:00 (UTC) although that’s still a few hours outside of the mentioned timeframe.

I’ll close this issue then and consider it resolved.

capabhaypsh commented 4 years ago

# output_error How can solve these errror ..can anybody suggest me