I have a database that for some reason I cannot interact with through consoles. My website is currently working fine, and the data appears to be up to date.
-
When I try to update a db item from my site, it works fine, and the changes are made.
-
When I try to access the db from the same python file the site would use, I get the error found at the bottom of this post. The most relevant bit being:
.
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None
I found a stackoverflow question that closely resembles my case here. While no answer was accepted, the most upvoted solution seems to suggest I do not currently have write access to the directory.
I have tried refreshing the site but it was no better.
Any idea how I can regain access to my db from consoles?
Traceback (most recent call last):
File "/home/ExperimentsWithCode/getmebro/sqlalchemy_update.py", line 9, in <module>
from sqlalchemy_declarative3 import Base, Users, Accounts, Contacts, History, Records
File "/home/ExperimentsWithCode/getmebro/sqlalchemy_declarative3.py", line 175, in <module>
Base.metadata.create_all(engine)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 2848, in create_all
tables=tables)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1478, in _run_visitor
with self._optional_conn_ctx_manager(connection) as conn:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1471, in _optional_conn_ctx_manager
with self.contextual_connect() as conn:
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1661, in contextual_connect
self.pool.connect(),
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 272, in connect
return _ConnectionFairy(self).checkout()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 431, in __init__
rec = self._connection_record = pool._do_get()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 867, in _do_get
return self._create_connection()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 225, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 318, in __init__
self.connection = self.__connect()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 379, in __connect
connection = self.__pool._creator()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 283, in connect
return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None