n3d1117 / chatgpt-telegram-bot

🤖 A Telegram bot that integrates with OpenAI's official ChatGPT APIs to provide answers, written in Python
GNU General Public License v2.0
3.08k stars 1.41k forks source link

Bot stuck without any log/traceback #500

Open Jipok opened 11 months ago

Jipok commented 11 months ago

I noticed that after switching to using PROXY, the bot simply began to freeze about once every 2-3 days. It does not respond to messages in telegram (even /help) and everything is fine in the logs. The application stops by ctrl-с without any logs. It looks like this:

...
2023-12-14 12:46:34,884 - root - INFO - New message received from user @Jipok (id: 354339153)
^C2023-12-15 14:56:53,751 - telegram.ext.Application - INFO - Application is stopping. This might take a moment.
2023-12-15 14:56:53,751 - telegram.ext.Application - INFO - Application.stop() complete

After a restart, everything works fine.

I assume that the problem is on the part of the telegram bot(perhaps an infinite timeout somewhere). And for now I’ll replace the PROXY with OPENAI_PROXY, since telegram is still working without problems in my country. I will post before the end of the year if this replacement helps solve the problem.

Jipok commented 10 months ago

Not a single stuck in the last 10 days. So the problem is almost certainly in using a proxy for telegram.

Jipok commented 9 months ago

No one stuck since use OPENAI_PROXY.