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

Implement better error message when DB is locked #5

Open
SteveClement opened this issue Feb 12, 2024 · 0 comments
Open

Implement better error message when DB is locked #5

SteveClement opened this issue Feb 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@SteveClement
Copy link
Member

SteveClement commented Feb 12, 2024

When the sqlite DB is locked, exit graciously (and earlier)

catch: sqlite3.OperationalError: database is locked

./feeder.py chats
Traceback (most recent call last):
  File "/home/ail/ail-feeder-telegram/bin/./feeder.py", line 138, in <module>
    tg.connect()
  File "/home/ail/ail-feeder-telegram/bin/telegram.py", line 93, in connect
    self.client.start()
  File "/home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/client/auth.py", line 128, in start
    else self.loop.run_until_complete(coro)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/client/auth.py", line 135, in _start
    await self.connect()
  File "/home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/client/telegrambaseclient.py", line 555, in onnect
    self.session.auth_key = self._sender.auth_key
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/sessions/sqlite.py", line 180, in auth_key
    self._update_session_table()
  File "/home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/sessions/sqlite.py", line 194, in _update_session_table
    c.execute('delete from sessions')
sqlite3.OperationalError: database is locked
Task was destroyed but it is pending!
task: <Task pending name='Task-3' coro=<Connection._send_loop() running at /home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/network/connection/connection.py:316> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-4' coro=<Connection._recv_loop() running at /home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/network/connection/connection.py:335> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-5' coro=<MTProtoSender._send_loop() running at /home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/network/mtprotosender.py:464> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<MTProtoSender._recv_loop() running at /home/ail/ail-feeder-telegram/venv/lib/python3.11/site-packages/telethon/network/mtprotosender.py:507> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Exception ignored in: <coroutine object Connection._recv_loop at 0x7326305854e0>
RuntimeError: coroutine ignored GeneratorExit
@SteveClement SteveClement added the enhancement New feature or request label Feb 12, 2024
@SteveClement SteveClement transferred this issue from ail-project/ail-feeder-image Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant