Open andrevmatos opened 6 years ago
Hi @andrevmatos !
I'm getting the same error while trying to connect to a server. What did you exactly do to solve the problem? I can't get it work.
Here is the piece of code i modified tonight:
try: waittime = response.json()['retry_after_ms'] / 1000 except KeyError: try: errordata = json.loads(response.json()['error']) waittime = errordata['retry_after_ms'] / 1000 except json.JSONDecodeError: pass except KeyError: pass sleep(waittime) else: break
Style get the same "simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)" problem.
Thanks by advance !
Hi, @MyDev45 . my solution for now was to handle the exception myself and implement a retry loop, outside matrix_client. The patch should be simple though, if you can fork or reinstantiate the classes.
We got a small federation running for Raiden Network, and because of some disk full issue, one of the servers crashed. Following it, the healthy ones started returning some unexpected responses for interactions with users on the healthy ones. E.g. trying to invite an user in the unhealthy server to a room in the healthy one, the invite request returned:
but from https://github.com/matrix-org/matrix-python-sdk/blob/e366d52850f2bd948e9613022b735054616cfe0b/matrix_client/api.py#L731-L735 if the
error
isn't a json,json.JSONDecodeError
will be raised. Quick fix is to addjson.JSONDecodeError
to the handled errors in L734 Full stack traces and context can be found in raiden-network/raiden#2603