Skip to content
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

Reconnect to psql when connection lost #153

Open
HarHarLinks opened this issue Feb 13, 2024 · 0 comments
Open

Reconnect to psql when connection lost #153

HarHarLinks opened this issue Feb 13, 2024 · 0 comments

Comments

@HarHarLinks
Copy link
Collaborator

2024-02-12 10:13:33,777 | matrix_reminder_bot.callbacks [ERROR] Unknown error while processing command:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/callbacks.py", line 113, in message
    await command.process()
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/bot_commands.py", line 305, in process
    await self._remind_me()
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/functions.py", line 99, in inner
    await command_func(self, *args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/bot_commands.py", line 339, in _remind_me
    await self._remind(target=self.event.sender)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/bot_commands.py", line 297, in _remind
    self.store.store_reminder(reminder)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/storage.py", line 359, in store_reminder
    self._execute(
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/storage.py", line 71, in _execute
    self.cursor.execute(args[0].replace("?", "%s"), *args[1:])
psycopg2.OperationalError: server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.

2024-02-12 10:14:04,152 | matrix_reminder_bot.callbacks [ERROR] Unknown error while processing command:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/callbacks.py", line 113, in message
    await command.process()
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/bot_commands.py", line 330, in process
    await self._delete_reminder()
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/functions.py", line 99, in inner
    await command_func(self, *args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/bot_commands.py", line 530, in _delete_reminder
    reminder.cancel()
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/reminder.py", line 181, in cancel
    self.store.delete_reminder(self.room_id, self.reminder_text)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/storage.py", line 388, in delete_reminder
    self._execute(
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/storage.py", line 71, in _execute
    self.cursor.execute(args[0].replace("?", "%s"), *args[1:])
psycopg2.InterfaceError: cursor already closed
2024-02-12 10:15:00,555 | apscheduler.executors.default [ERROR] Job "Reminder._fire (trigger: date[2024-02-12 10:15:00 CET], next run at: 2024-02-12 10:15:00 CET)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/reminder.py", line 145, in _fire
    self.cancel(cancel_alarm=False)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/reminder.py", line 181, in cancel
    self.store.delete_reminder(self.room_id, self.reminder_text)
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/storage.py", line 388, in delete_reminder
    self._execute(
  File "/usr/local/lib/python3.11/site-packages/matrix_reminder_bot/storage.py", line 71, in _execute
    self.cursor.execute(args[0].replace("?", "%s"), *args[1:])
psycopg2.InterfaceError: cursor already closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant