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 Locking #143

Closed
ghost opened this issue Sep 17, 2015 · 2 comments
Closed

Database Locking #143

ghost opened this issue Sep 17, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 17, 2015

I'm receiving the following error when using the acd_cli upload command, or doing any sync is there a reason this keeps happening that I'm unaware of? I'm using latest acd_cli version

[CRITICAL] [acdcli.cache.db] - Error opening database: (sqlite3.OperationalError) database is locked [SQL: 'PRAGMA table_info("metadata")']
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
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/acd_cli", line 9, in <module>
    load_entry_point('acdcli==0.3.0a6', 'console_scripts', 'acd_cli')()
  File "/usr/local/bin/acd_cli.py", line 1248, in main
    cache = db.NodeCache(CACHE_PATH, args.check)
  File "/usr/local/lib/python3.4/dist-packages/acdcli/cache/db.py", line 64, in __init__
    raise e
  File "/usr/local/lib/python3.4/dist-packages/acdcli/cache/db.py", line 58, in __init__
    uninitialized = not self.engine.has_table(schema.Metadate.__tablename__) and \
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 2069, in has_table
    return self.run_callable(self.dialect.has_table, table_name, schema)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1972, in run_callable
    return conn.run_callable(callable_, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1477, in run_callable
    return callable_(self, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/dialects/sqlite/base.py", line 1127, in has_table
    connection, "table_info", table_name, schema=schema)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/dialects/sqlite/base.py", line 1468, in _get_table_pragma
    cursor = connection.execute(statement)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 906, in execute
    return self._execute_text(object, multiparams, params)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1054, in _execute_text
    statement, parameters
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/util/compat.py", line 188, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/util/compat.py", line 181, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked [SQL: 'PRAGMA table_info("metadata")']
@yadayada
Copy link
Owner

Please run acdcli -v init to find out where your cache path is and then run fuser <CACHE_PATH>/nodes.db to find out if another process is locking the database.

@yadayada yadayada added the cache label Sep 17, 2015
@yadayada
Copy link
Owner

Did you have multiple instances running? If so, this issue might be a duplicate of #124.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant