OperationalError no such table dashboards
See original GitHub issue- [*] I have checked the superset logs for python stacktraces and included it here as text if any
- [*] I have reproduced the issue with at least the latest released version of superset
- [*] I have checked the issue tracker for the same issue and I haven’t found one similar
Superset version
0.19.1
Expected results
After Logging in shows dashboards
Actual results
The correct results show when running server in debug mode:
superset runserver -d
However when running as a server: superset runserver
I get the following:
Exception on /dashboardmodelviewasync/api/read [GET]
Traceback (most recent call last):
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask_appbuilder/security/decorators.py", line 52, in wraps
return f(self, *args, **kwargs)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask_appbuilder/views.py", line 218, in api_read
count, lst = self.datamodel.query(joined_filters, order_column, order_direction, page=page, page_size=page_size)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/flask_appbuilder/models/sqla/interface.py", line 111, in query
count = query_count.scalar()
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2843, in scalar
ret = self.one()
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2814, in one
ret = self.one_or_none()
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2784, in one_or_none
ret = list(self)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
return self._execute_and_instances(context)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
context)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
context)
File "/home/centos/supersets/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
cursor.execute(statement, parameters)
OperationalError: (sqlite3.OperationalError) no such table: dashboards [SQL: u'SELECT count(?) AS count_1 \nFROM dashboards'] [parameters: ('*',)]
Steps to reproduce
Fresh install on Centos: CentOS Linux release 7.4.1708
Python version 2.7.5
Follow steps in:
(Including the Load some data step)
Set the db connection to a local sqlite3 db.
In superset_config.py SQLALCHEMY_DATABASE_URI = 'sqlite:////home/centos/superset/superset_meta.db '
Additionally the upgrade steps after the Load some Data step do not change the error.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
apache/superset - OperationalError no such table dashboards
Set the db connection to a local sqlite3 db. In superset_config.py SQLALCHEMY_DATABASE_URI = 'sqlite:////home/centos/superset/superset_meta.db '.
Read more >(sqlite3.OperationalError) no such table: mytable - Stack ...
I try to build a dashboard. to track my orders, revenue etc. to do this, I created a database that include all the...
Read more >DBNonExistentTable: (sqlite3.OperationalError) no such table
I'm getting the same error. Can't log in to my dashboard because keystone wont work.
Read more >(sqlite3.OperationalError) no such table: books : r/flask - Reddit
Construction worker learning Python Hoping I could get some feedback on my latest Project, Terrace Dashboard (Fastapi, Websockets, HTML CSS JS).
Read more >Yum update fails with traceback: sqlite3.OperationalError: no ...
OperationalError : no such table: trans_beg" Version-Release number of selected component (if applicable): Using Fedora 14, KDE 4.6.2 using 2.6.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If this is in linux, you will need to identify the working path you want to use and you will do:
export PYTHONPATH=/your/working/path:$PYTHONPATH
I added that line to the bash scripts that were running. It’s been a while and I no longer have access to those files but I believe I modified the actual upgrade, init and runserver scripts where superset was running from.So I exported to
PYTHONPATH
the directory, using export before calling the command and setting it for the subshell command, and they both yielded the same result (error).I then changed the default port to 8081 to make sure that it was using the correct superset_config.py
Once I did that I realized the superset runserver -d was not picking up the port change, so is that running using the
/home/centos/.superset/superset.db
?I then set the environment variable from the bash script, and then refreshed the shell. Then I went through the DB update steps and it worked.
The issue was that when I was running the other superset commands the PYTHONPATH did not have the working directory as the first directory. After setting it to be the first, I then did:
and it worked.
Thank you so much for all your help!