question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sqlite3.OperationalError: database is locked

See original GitHub issue

Hello,

Running telethon client with multi workers under pool executor causes constant database locks:

ERROR:telethon.telegram_bare_client:Connection was reset while receiving items. Reconnecting ERROR:telethon.telegram_bare_client:Connection was reset while receiving items. Reconnecting ERROR:telethon.telegram_bare_client:Unknown exception in the read thread! Disconnecting and leaving it to main t Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/telethon/telegram_bare_client.py", line 690, in _recv_thread_impl self.idle(stop_signals=tuple()) File "/usr/local/lib/python3.4/dist-packages/telethon/telegram_bare_client.py", line 659, in idle self._sender.receive(update_state=self.updates) File "/usr/local/lib/python3.4/dist-packages/telethon/network/mtproto_sender.py", line 147, in receive self._process_msg(remote_msg_id, remote_seq, reader, update_state) File "/usr/local/lib/python3.4/dist-packages/telethon/network/mtproto_sender.py", line 197, in _process_msg return self._handle_rpc_result(msg_id, sequence, reader) File "/usr/local/lib/python3.4/dist-packages/telethon/network/mtproto_sender.py", line 496, in _handle_rpc_res self.session.process_entities(request.result) File "/usr/local/lib/python3.4/dist-packages/telethon/session.py", line 405, in process_entities 'insert or replace into entities values (?,?,?,?,?)', rows sqlite3.OperationalError: database is locked

Is there a way we can fix this?

Thank you, Andrei.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Lonamicommented, Feb 23, 2018

Well you should know if you have a connected client on a certain file.

2reactions
Lonamicommented, Feb 23, 2018

That’s not a problem related to the library, and you should ask somewhere else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OperationalError: database is locked - python - Stack Overflow
OperationalError : database is locked errors indicate that your application is experiencing more concurrency than sqlite can handle in default ...
Read more >
sqlite3.OperationalError: database is locked - Pyrogram
This error occurs when more than one process is using the same session file, that is, when you run two or more clients...
Read more >
How to Fix SQLite Error Database is Locked - Error Code 5
This error code occurs when the user tries to perform two inappropriate operations on a database at the same detail and on the...
Read more >
sqlite3.OperationalError: database is locked #820 - GitHub
Received sqlite3.OperationalError: database is locked error with only 2 processes optimizing on the same study. Both processes stopped ...
Read more >
OperationalError: database is locked - Intellipaat Community
The practical reason for this is usually that the python or django shells have opened a request to the DB and it has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found