You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Errors related to the inability to connect to the database became more frequent.
Error message:
[2024-07-19 12:03:13,331] INFO [logger.logger:authorization:363] [class.Users] Check role `reschedule_queue`for user `123456789`: allowed
[2024-07-19 12:03:13,574] ERROR [logger.logger:handle:27] [Bot]: Error: cursor already closed
Exception in thread WorkerThread2:
Traceback (most recent call last):
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 93, in run
task(*args, **kwargs)
File "/home/pyinstabot-downloader/app/src/bot.py", line 466, in reschedule_queue
database.update_schedule_time_in_queue(
File "/home/pyinstabot-downloader/app/src/modules/database.py", line 522, in update_schedule_time_in_queue
self._update(
File "/home/pyinstabot-downloader/app/src/modules/database.py", line 291, in _update
self.cursor.execute(f"UPDATE {table_name} SET {values} WHERE {condition}")
psycopg2.InterfaceError: cursor already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
self.run()
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 103, in run
self.exception_callback(self, self.exception_info)
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 140, in on_exception
handled = self.telebot.exception_handler.handle(exc_info)
File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telegram/telegram.py", line 28, in handle
raise FailedToCreateInstance("Failed to create the bot instance.") from exception
telegram.exceptions.FailedToCreateInstance: Failed to create the bot instance.
Additional context
Information about where the bug is happening:
None
Possible correction
Attempt to recreate the connection and courses if an exception occurs
Make sure that course closure is caused by external circumstances and not by a code error when the course is closed programmatically
Screenshots
None
Check list after fixing the bug
Cursor closing is no longer a critical error causing bot threads to crash
The text was updated successfully, but these errors were encountered:
Describe the bug
Errors related to the inability to connect to the database became more frequent.
Error message:
Additional context
Information about where the bug is happening:
None
Possible correction
Screenshots
None
Check list after fixing the bug
The text was updated successfully, but these errors were encountered: