So far the bot was working fine, recently I started receiving an error and the bot is not responding.
Here the error:
[2020-03-22 09:58:39 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://mybot.example.com/webhooks/telegram/webhook'
Traceback (most recent call last):
File "/build/lib/python3.6/site-packages/sanic/app.py", line 942, in handle_request
response = await response
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
return self.gen.send(None)
File "/build/lib/python3.6/site-packages/rasa/core/channels/telegram.py", line 215, in message
if self._is_user_message(msg):
File "/build/lib/python3.6/site-packages/rasa/core/channels/telegram.py", line 175, in _is_user_message
return message.text is not None
AttributeError: 'NoneType' object has no attribute 'text'
I did no change anything or restarted the service, and it started behaving like that.
ok, Sorry , I see because I too faced a issue sometimes back(not on telegram but rest channel) and when I checked the trace I got to know the bot was responding with empty response so thought might be same issue.
@alebeta90 is it possible your users are sending e.g. voice messages or something? Not sure what that looks like in terms of an API call from telegram, but then the message might be None. If that’s the case we should handle that in our code though
Yesterday I had a nice talk with the guys from python-telegram-bot package about what is happening, and they help me to solve it using the Telegram Bot API.
Basically it seems that Rasa Telegram connector is not handling the Updates properly, and there were some messages which did not receive something call the offset (I think is a reply saying that the message was received maybe) the offset should be set with a number equal to update_id+1. Then what I did was:
Stop Rasa instance
Delete Webhook (Telegram Bot API)
Update offset value(update_id)(Telegram Bot API)
start rasa again
I think something should be solve on the side of the Telegram connector in this function