Skip to content

Instantly share code, notes, and snippets.

@jethrosun
Created April 20, 2016 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jethrosun/a9bbcdbfb8b623fa3e8061ee81610e95 to your computer and use it in GitHub Desktop.
Save jethrosun/a9bbcdbfb8b623fa3e8061ee81610e95 to your computer and use it in GitHub Desktop.
HaaS build errors on Ubuntu

# Ubuntu

With python default version as 2.7, the installation is correct but I came with the same error Kyle met, i.e. "OperationError unable to open database"

Solved by manualy create haas.db

sqlite3 haas.db

chown -R www-data haas.db

In conclusion, clearly Linux distro with Python2 default will probably meet this OperationError.

archie@archie-vbox:~/git/haas$ uname -r 4.5.0-rc4+

archie@archie-vbox:~/git/haas$ python --version Python 2.7.6

(.env) archie@archie-vbox:~/git/haas$ haas-admin db create /usr/local/lib/python2.7/dist-packages/Flask_SQLAlchemy-2.1-py2.7.egg/flask_sqlalchemy/__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True to suppress this warning. warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True to suppress this warning.') Traceback (most recent call last): File "/usr/local/bin/haas-admin", line 9, in <module> load_entry_point('haas==0.2rc2', 'console_scripts', 'haas-admin')() File "/usr/local/lib/python2.7/dist-packages/haas-0.2rc2-py2.7.egg/haas/commands/admin.py", line 14, in main manager.run() File "/usr/local/lib/python2.7/dist-packages/Flask_Script-2.0.5-py2.7.egg/flask_script/__init__.py", line 412, in run result = self.handle(sys.argv[0], sys.argv[1:]) File "/usr/local/lib/python2.7/dist-packages/Flask_Script-2.0.5-py2.7.egg/flask_script/__init__.py", line 383, in handle res = handle(args,config) File "/usr/local/lib/python2.7/dist-packages/Flask_Script-2.0.5-py2.7.egg/flask_script/commands.py", line 216, in __call__ return self.run(args, kwargs) File "/usr/local/lib/python2.7/dist-packages/haas-0.2rc2-py2.7.egg/haas/commands/db.py", line 9, in create create_db() File "/usr/local/lib/python2.7/dist-packages/haas-0.2rc2-py2.7.egg/haas/migrations.py", line 50, in create_db db.create_all() File "/usr/local/lib/python2.7/dist-packages/Flask_SQLAlchemy-2.1-py2.7.egg/flask_sqlalchemy/__init__.py", line 972, in create_all self._execute_for_all_tables(app, bind, 'create_all') File "/usr/local/lib/python2.7/dist-packages/Flask_SQLAlchemy-2.1-py2.7.egg/flask_sqlalchemy/__init__.py", line 964, in _execute_for_all_tables op(bind=self.get_engine(app, bind),extra) File "build/bdist.linux-x86_64/egg/sqlalchemy/sql/schema.py", line 3695, in create_all File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1855, in _run_visitor File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1848, in _optional_conn_ctx_manager File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 2039, in contextual_connect File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 2078, in _wrap_pool_connect File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1405, in _handle_dbapi_exception_noconnection File "build/bdist.linux-x86_64/egg/sqlalchemy/util/compat.py", line 200, in raise_from_cause File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 2074, in _wrap_pool_connect File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 376, in connect File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 713, in _checkout File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 480, in checkout File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 1151, in _do_get File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 323, in _create_connection File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 449, in __init__ File "build/bdist.linux-x86_64/egg/sqlalchemy/pool.py", line 607, in __connect File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/strategies.py", line 97, in connect File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py", line 385, in connect sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

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