Bot goes offline regularly after running for a while #151
Closed
Description
My bot fails with an error after having been running for a while (usually days). I see this error:
2018-11-30 05:33:52,710: Backing off watch_control_stream(...) for 1.0s (requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read)))
2018-11-30 05:34:23,104: Giving up watch_control_stream(...) after 2 tries (json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0))
Process Process-2:
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "<path-to-my-venv>/lib/python3.5/site-packages/backoff/_sync.py", line 99, in retry
ret = target(*args, **kwargs)
File "lichess-bot.py", line 44, in watch_control_stream
event = json.loads(evnt.decode('utf-8'))
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This is not related to any games, as it happens hours after it played the last game. After this error the bot doesn't show as being online anymore, but lichess-bot doesn't exit either. Hitting Ctrl+C doesn't make it exit, I have to kill it. Any help appreciated.
Metadata
Assignees
Labels
No labels