osuosl / orvsd_central

5 stars 2 forks source link

[Setup/Docs] SQLAlchemy error on python manage.py setup_db #163

Open dean opened 9 years ago

dean commented 9 years ago

Completely clean install with all dependencies as well:

Traceback (most recent call last):
  File "manage.py", line 184, in <module>
    manager.run()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/flask_script/__init__.py", line 423, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/flask_script/__init__.py", line 402, in handle
    return handle(app, *positional_args, **kwargs)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/flask_script/commands.py", line 145, in handle
    return self.run(*args, **kwargs)
  File "manage.py", line 170, in setup_db
    command.stamp(alembic_cfg, "head")
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/alembic/command.py", line 257, in stamp
    script.run_env()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/alembic/script.py", line 199, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/alembic/util.py", line 205, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/alembic/compat.py", line 58, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "migrations/env.py", line 130, in <module>
    run_migrations_online()
  File "migrations/env.py", line 96, in run_migrations_online
    rec['connection'] = conn = engine.connect()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1678, in connect
    return self._connection_cls(self, **kwargs)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 59, in __init__
    self.__connection = connection or engine.raw_connection()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1747, in raw_connection
    return self.pool.unique_connection()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 272, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 608, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 425, in checkout
    rec = pool._do_get()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 1027, in _do_get
    return self._create_connection()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 277, in _create_connection
    return _ConnectionRecord(self)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 396, in __init__
    self.connection = self.__connect()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 509, in __connect
    connection = self.__pool._creator()
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 95, in connect
    connection_invalidated=invalidated
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 89, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/vagrant/orvsd_central/env/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 366, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None
dean commented 9 years ago

As a side note, tables are still created for the db.

dean commented 9 years ago

The issue was an extra

sqlalchemy.url = sqlite:///db/orvsd_test.db

at the end of the alembic config for [engine1]. Fix is easy, clean up the alembic file.