nickoala / telepot

Python framework for Telegram Bot API
MIT License
2.42k stars 474 forks source link

Bot stops receiving updates after error #342

Open CrocutaCrocuta opened 6 years ago

CrocutaCrocuta commented 6 years ago

Traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/telepot/loop.py", line 60, in run_forever
    allowed_updates=allowed_updates)
  File "/usr/local/lib/python2.7/dist-packages/telepot/__init__.py", line 993, in getUpdates
    return self._api_request('getUpdates', _rectify(p))
  File "/usr/local/lib/python2.7/dist-packages/telepot/__init__.py", line 491, in _api_request
    return api.request((self._token, method, params, files), **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/telepot/api.py", line 155, in request
    return _parse(r)
  File "/usr/local/lib/python2.7/dist-packages/telepot/api.py", line 136, in _parse
    raise exception.BadHTTPResponse(response.status, text, response)
BadHTTPResponse: (502, u'<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.12.2</center>\r\n</body>\r\n</html>\r\n', <urllib3.response.HTTPResponse object at 0x7f2cd111fed0>)

API version 12.5, installed via PIP.

das7pad commented 6 years ago

Hello @CrocutaCrocuta,

the loop is put on hold for 30 seconds in the shown case, but should continue to pull updates later on.

Can you confirm that it just prints the error and continues to receive updates after the delay?

icebergyy commented 6 years ago

I've had the same issue lately. Can I shorten that 30 second time?

I am getting the same error and the bot will stop receiving after the error.

I installed telepot from the github repo.

lucidBrot commented 6 years ago

Just had the same issue. My bot did not respond for two days. Interestingly, when I tried to abort the command and start the bot again - using CTRL+C - it suddenly started pulling updates again instead of being aborted.

To be clear, I'm using MessageLoop with a DelegatorBot