superset icon indicating copy to clipboard operation
superset copied to clipboard

OperationalError: No such table dbs

Open btzo opened this issue 10 years ago • 4 comments

I installed on a Ubuntu 14.04 machine. When I run the server, I can see that the CSS/HTML side seems to work nicely but it don't load the data.

image

When I click at Source > database I have the following error:

16-04-10 22:28:12,920:INFO:werkzeug:127.0.0.1 - - [10/Apr/2016 22:28:12] "GET /databaseview/list/ HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/views.py", line 365, in list
    widgets = self._list()
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/baseviews.py", line 870, in _list
    page_size=page_size)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/baseviews.py", line 785, in _get_list_widget
    count, lst = self.datamodel.query(joined_filters, order_column, order_direction, page=page, page_size=page_size)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/models/sqla/interface.py", line 105, in query
    count = query_count.scalar()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2724, in scalar
    ret = self.one()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2693, in one
    ret = list(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2736, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (sqlite3.OperationalError) no such table: dbs [SQL: u'SELECT count(?) AS count_1 \nFROM dbs'] [parameters: ('*',)]
2016-04-10 22:28:13,194:INFO:werkzeug:127.0.0.1 - - [10/Apr/2016 22:28:13] "GET /databaseview/list/?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
2016-04-10 22:28:13,225:INFO:werkzeug:127.0.0.1 - - [10/Apr/2016 22:28:13] "GET /databaseview/list/?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
2016-04-10 22:28:13,225:INFO:werkzeug:127.0.0.1 - - [10/Apr/2016 22:28:13] "GET /databaseview/list/?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
2016-04-10 22:28:13,449:INFO:werkzeug:127.0.0.1 - - [10/Apr/2016 22:28:13] "GET /databaseview/list/?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
2016-04-10 22:28:13,672:INFO:werkzeug:127.0.0.1 - - [10/Apr/2016 22:28:13] "GET /databaseview/list/?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

Any idea of why it didn't find the dbs table?

btzo avatar Apr 10 '16 20:04 btzo

@mikebotazzo please check your db connection and follow http://airbnb.io/caravel/installation.html Also make sure you have followed these steps:

Initialize the database

caravel db upgrade

Create default roles and permissions

caravel init

Load some data to play with

caravel load_examples

After that you can manually check your sqlite db to see if its populated. OperationalError: (sqlite3.OperationalError) no such table: dbs [SQL: u'SELECT count(?) AS count_1 \nFROM dbs'] [parameters: ('*',)] means the expected table is not in the db. So make sure you are pointing to right db settings in config.py

sid88in avatar Apr 10 '16 21:04 sid88in

dbs table reference is coming from here: https://github.com/airbnb/caravel/blob/master/caravel/models.py#L294

sid88in avatar Apr 10 '16 21:04 sid88in

Yeah it looks like you skipped some of the installation steps.

mistercrunch avatar Apr 19 '16 03:04 mistercrunch

Is 8088 the default port ?

Sarrae1406 avatar Dec 13 '16 06:12 Sarrae1406