superset不能加载数据

cyaolong
  • 13

在安装好superset后打算用命令superset load_examples加载示例数据,但是命令行内提示了这些错误,多次网页搜索不得结果。到底这是哪方面的错误?

         Traceback (most recent call last):
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: logs

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/superset/models/core.py", line 772, in wrapper
    sesh.commit()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 874, in commit
    self.transaction.commit()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 461, in commit
    self._prepare_impl()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 441, in _prepare_impl
    self.session.flush()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2139, in flush
    self._flush(objects)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2259, in _flush
    transaction.rollback(_capture_exception=True)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2223, in _flush
    flush_context.execute()
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
    rec.execute(self)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
    uow
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
    mapper, table, insert)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 835, in _emit_insert_statements
    execute(statement, params)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/Users/cyaolong/.virtualenvs/env1/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: logs [SQL: 'INSERT INTO logs (action, user_id, dashboard_id, slice_id, json, dttm, dt, duration_ms, referrer) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('import_dashboards', '1', None, 0, '{}', '2017-08-10 12:57:08.022755', '2017-08-10', 78.621, 'http://localhost:8088/superset/profile/cyaolong/')]

      
回复
阅读 4.8k
2 个回答

已经解决了,其实是因为漏了操作superset db upgrade初始化数据库。

sqlite 中没有 logs 这张表。(这不写得很清楚么)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏