我使用开源 BI 工具 Superset 搭了一个业务看板,其它方面没得说,确实挺棒的
但就是有一个问题:在每次进入 Dashboard 的时候,会出现这样的报错:
需要刷新很多次才能好
完整报错代码如下:
Traceback (most recent call last):
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 755, in _commit_impl
self.engine.dialect.do_commit(self.connection)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 534, in do_commit
dbapi_connection.commit()
sqlite3.OperationalError: database is locked
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
return f(self, *args, **kwargs)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/superset/views/core.py", line 1796, in dashboard
edit_mode=edit_mode,
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/superset/utils/log.py", line 78, in wrapper
referrer=referrer,
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/superset/utils/log.py", line 161, in log
sesh.commit()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 162, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1036, in commit
self.transaction.commit()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 507, in commit
t[1].commit()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1727, in commit
self._do_commit()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1758, in _do_commit
self.connection._commit_impl()
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 757, in _commit_impl
self._handle_dbapi_exception(e, None, None, None, None)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
raise value.with_traceback(tb)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 755, in _commit_impl
self.engine.dialect.do_commit(self.connection)
File "/root/.pyenv/versions/3.6.5/envs/venv-3.6.5/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 534, in do_commit
dbapi_connection.commit()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
(Background on this error at: http://sqlalche.me/e/e3q8)
初步判断是 sqlite3 的问题,在读数据库的时候遇到锁了,但是咱 python 太菜了,不知道有什么好的方法可以改一下(例如增加等待时间啥的)
因此希望求助各位大佬,能解决的给一个大红包,拜谢了
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.