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

Running bedup as root, then as a normal user results in a unhelpful error message #94

Open
leijurv opened this issue Jan 7, 2018 · 0 comments

Comments

@leijurv
Copy link

leijurv commented Jan 7, 2018

The sqlite database can't be read, because it was created as root, and my normal user doesn't have permission to read it.

The resulting error simply says it was unable to read the database file, so I thought it might be corrupted or missing, but actually it just didn't have permission.

bedup dedup --size-cutoff 1000000 | tee -a ~/.bedup.log
Traceback (most recent call last):
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2158, in _wrap_pool_connect
    return fn()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 345, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 782, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 532, in checkout
    rec = pool._do_get()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 1089, in _do_get
    c = self._create_connection()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 350, in _create_connection
    return _ConnectionRecord(self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 477, in __init__
    self.__connect(first_connect_check=True)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 679, in __connect
    pool.dispatch.connect(self.connection, self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/event/attr.py", line 256, in __call__
    fn(*args, **kw)
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/__main__.py", line 88, in sql_setup
    cur.execute('PRAGMA journal_mode = WAL')
sqlite3.OperationalError: unable to open database file

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

Traceback (most recent call last):
  File "/home/leijurv/.local/bin/bedup", line 11, in <module>
    sys.exit(script_main())
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/__main__.py", line 497, in script_main
    sys.exit(main(sys.argv))
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/__main__.py", line 486, in main
    return args.action(args)
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/__main__.py", line 122, in vol_cmd
    sess = get_session(args)
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/__main__.py", line 103, in get_session
    upgrade_schema(engine)
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/migrations.py", line 38, in upgrade_schema
    context = MigrationContext.configure(engine.connect())
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2102, in connect
    return self._connection_cls(self, **kwargs)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 90, in __init__
    if connection is not None else engine.raw_connection()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2188, in raw_connection
    self.pool.unique_connection, _connection)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2162, in _wrap_pool_connect
    e, dialect, self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception_noconnection
    exc_info
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2158, in _wrap_pool_connect
    return fn()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 345, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 782, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 532, in checkout
    rec = pool._do_get()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 1089, in _do_get
    c = self._create_connection()
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 350, in _create_connection
    return _ConnectionRecord(self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 477, in __init__
    self.__connect(first_connect_check=True)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/pool.py", line 679, in __connect
    pool.dispatch.connect(self.connection, self)
  File "/home/leijurv/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.0-py3.5-linux-x86_64.egg/sqlalchemy/event/attr.py", line 256, in __call__
    fn(*args, **kw)
  File "/home/leijurv/.local/lib/python3.5/site-packages/bedup-0.10.1-py3.5-linux-x86_64.egg/bedup/__main__.py", line 88, in sql_setup
    cur.execute('PRAGMA journal_mode = WAL')
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: http://sqlalche.me/e/e3q8)
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

1 participant