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.

OperationalError: database is locked after upgrade from 2.21.32

See original GitHub issue

Hello I updated my flexget from 2.21.32 to the lates 3.0.25 and I had to update the python to 3.7.3 on debian 10. Now I can’t start flexget, this is the error, even in flexget check


Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 755, in _commit_impl
    self.engine.dialect.do_commit(self.connection)
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/default.py", line 534, in do_commit
    dbapi_connection.commit()
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/flexget", line 10, in <module>
    sys.exit(main())
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/__init__.py", line 41, in main
    manager.start()
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/manager.py", line 356, in start
    self.initialize()
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/manager.py", line 214, in initialize
    self.load_config()
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/manager.py", line 675, in load_config
    self.update_config(config)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/manager.py", line 686, in update_config
    self.config = self.validate_config(config)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/manager.py", line 742, in validate_config
    config = fire_event('manager.before_config_validate', config, self)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/event.py", line 110, in fire_event
    result = event(*args, **kwargs)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/event.py", line 20, in __call__
    return self.func(*args, **kwargs)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/components/variables/variables.py", line 86, in process_variables
    variables_to_db(variables)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/components/variables/variables.py", line 61, in variables_to_db
    session.merge(variables)
  File "/home/downloader/.local/lib/python3.7/site-packages/flexget/utils/sqlalchemy_utils.py", line 138, in __exit__
    self.commit()
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/orm/session.py", line 1027, in commit
    self.transaction.commit()
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/orm/session.py", line 498, in commit
    t[1].commit()
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 1727, in commit
    self._do_commit()
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 1758, in _do_commit
    self.connection._commit_impl()
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 757, in _commit_impl
    self._handle_dbapi_exception(e, None, None, None, None)
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py", line 755, in _commit_impl
    self.engine.dialect.do_commit(self.connection)
  File "/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/default.py", line 534, in do_commit
    dbapi_connection.commit()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
(Background on this error at: http://sqlalche.me/e/e3q8)

What can I do to solve this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
soloamcommented, Jan 7, 2020

I will try again! I ended up rolling back eventing because I didn’t want to have the system stopped that long! I’ll try to make the update again! I have the system installed outside the virtual ev! This is a good time to update to virtual env.

Thank you

0reactions
liiightcommented, Apr 11, 2020

Good to hear. Closing this for now, reopen if relevant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OperationalError: database is locked - python - Stack Overflow
This error means that one thread or process has an exclusive lock on the database connection and another thread timed out waiting for...
Read more >
Database is locked when "upgrading" from read to write - SQLite
I am writing an app using PHP and SQLite (using PDO) - not using WAL. There are cases I begin a transaction, retrieve...
Read more >
sqlite3.OperationalError: database is locked - Pyrogram
OperationalError : database is locked. This error occurs when more than one process is using the same session file, that is, when you...
Read more >
OperationalError: database is locked - Mailman-users - Lists
I'm happy to do that, but how do I migrate the data between the databases (after installing postgres and creating the database)? I've...
Read more >
Avoiding locked database with larger flows - Prefect Discourse
I have a simple but largish flow whose tasks I want to run in parallel, executed by the prefect_dask.DaskTaskRunner.
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