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

database is locked #36

Closed
dognk opened this issue May 9, 2020 · 3 comments
Closed

database is locked #36

dognk opened this issue May 9, 2020 · 3 comments
Assignees
Milestone

Comments

@dognk
Copy link

dognk commented May 9, 2020

  • telegram-upload version:0.2.1
  • Python version:3.7
  • Operating System:macos

Traceback (most recent call last):
File "/usr/local/bin/Telegram-upload", line 6, in
catch(upload)()
File "/usr/local/lib/python3.7/site-packages/telegram_upload/exceptions.py", line 25, in wrap
fn(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/telegram_upload/management.py", line 17, in upload
client = Client(config or default_config())
File "/usr/local/lib/python3.7/site-packages/telegram_upload/client.py", line 43, in init
super().init(config.get('session', 'telegram-upload'), config['api_id'], config['api_hash'], **kwargs)
File "/usr/local/lib/python3.7/site-packages/telethon/client/telegrambaseclient.py", line 250, in init
session = SQLiteSession(session)
File "/usr/local/lib/python3.7/site-packages/telethon/sessions/sqlite.py", line 47, in init
c.execute("select name from sqlite_master "
sqlite3.OperationalError: database is locked

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
url=XXXX
for f in "$url"*.mp4 ; do
Telegram-upload --to webcamcol "$f"
done

@Nekmo
Copy link
Owner

Nekmo commented May 10, 2020

From telethon docs:

An older process is still running and is using the same 'session' file.

This error occurs when two or more clients use the same session, that is, when you write the same session name to be used in the client:

You have an older process using the same session file.
You have two different scripts running (interactive sessions count too).
You have two clients in the same script running at the same time.
The solution is, if you need two clients, use two sessions. If the problem persists and you’re on Linux, you can use fuser my.session to find out the process locking the file. As a last resort, you can reboot your system.

https://docs.telethon.dev/en/latest/quick-references/faq.html#sqlite3-operationalerror-database-is-locked

@Nekmo Nekmo self-assigned this Nov 7, 2020
@Nekmo
Copy link
Owner

Nekmo commented Nov 7, 2020

TODO: Add this error to documentation.

@Nekmo Nekmo added this to the v0.4.0 milestone Nov 11, 2020
Nekmo added a commit that referenced this issue Nov 11, 2020
@Nekmo Nekmo closed this as completed Nov 11, 2020
@Nekmo
Copy link
Owner

Nekmo commented Nov 11, 2020

Added to documentation, thanks!

Nekmo added a commit that referenced this issue Nov 12, 2020
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

2 participants