-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bot is suddenly crashing #473
Comments
I'm having the same issue, had not figured it out yet. |
That's a common issue, I suppose is something related with Telegram servers? You can somehow """fix""" the problem putting the polling inside a while True loop, so when it fails, it'll restart automatically. Here I uploaded some examples: https://gist.github.com/EnforcerZhukov/37e0ae02cd7fb1cd01085b2de553dde4 |
bot.polling(none_stop=True) |
none_stop=True usually does nothing about the timeout errors and other errors, at least in all my bots |
@EnforcerZhukov ok, soon I will try to fix this problem. |
It's a lot harder than I thought. Back to |
Try bot.infinity_polling() |
Strong language removed Default INFO logging Logging dev mode switch attempts Bonk added. J Reply criteria fixed Logging and simple reply for our own messages Bot crash fix eternnoir/pyTelegramBotAPI#473 Help message fix Stickers logging added pip file added for ref Commands handling reworked to support mapping from JSON Direct message with dev mode enabled to print sticker details Settings moved to file and generic replies support
Strong language removed Default INFO logging Logging dev mode switch attempts Bonk added. J Reply criteria fixed Logging and simple reply for our own messages Bot crash fix eternnoir/pyTelegramBotAPI#473 Help message fix Stickers logging added pip file added for ref Commands handling reworked to support mapping from JSON Direct message with dev mode enabled to print sticker details Settings moved to file and generic replies support
Strong language removed Default INFO logging Logging dev mode switch attempts Bonk added. J Reply criteria fixed Logging and simple reply for our own messages Bot crash fix eternnoir/pyTelegramBotAPI#473 Help message fix Stickers logging added pip file added for ref Commands handling reworked to support mapping from JSON Direct message with dev mode enabled to print sticker details Settings moved to file and generic replies support
What version of pyTelegramBotAPI are you using?
- Latest
What OS are you using?
- Ubuntu
What version of python are you using?
- 3.4
Hi, Dear Community
Just want to say that I'm a novice and do not know very well both in programming and in the etiquette you have, so please forgive me in advance
I have a small bot with simple functions. It works well, but sometimes it crashed. After starting it always works for a while (always in different ways, it can work 40 hours or 2 hours) and then stops responding. I've been trying to solve this problem for more than a week, I've tried so many ways that I forgot even what I used
Remember I was getting this error
File "/lebot/telebot/util.py", line 58, in run task(*args, **kwargs) File "/lebot/telebot/__init__.py", line 159, in __retrieve_updates updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout) File "/lebot/telebot/__init__.py", line 129, in get_updates json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates) File "/lebot/telebot/apihelper.py", line 175, in get_updates return _make_request(token, method_url, params=payload) File "/lebot/telebot/apihelper.py", line 54, in _make_request timeout=(connect_timeout, read_timeout), proxies=proxy) File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 521, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=30)
Then I tried this solution #401
And then I stopped getting error reports in screen -list, only got this message:
There is no screen to be resumed matching 31786.mybot.
I also tried other solutions, but bot crushed sooner or later anyway
If necessary, I can give the bot code that I uploaded to the hosting
The text was updated successfully, but these errors were encountered: