重启服务器后seatable无法访问

Page unavailable

Sorry, but the requested page is unavailable due to a server hiccup.
Our engineers have been notified, so check back later.
页面报错如下:

我再重启服务器之前做了备份数据库和数据文件夹操作
我把虚机快照到刚部署完成的状态,然后用官方教程恢复数据,恢复之后依然有这个报错。

请路过的大佬帮忙看下有么有办法解决。

这是服务器没有正常启动,你看一下服务器日志有没有什么报错?配置是否更改过?

不好意思,刚开始接触开发者版,麻烦问下这类问题主要看哪个日志文件

Traceback (most recent call last):
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/utils/deprecation.py", line 116, in __call__
    response = self.process_request(request)
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/auth/middleware.py", line 34, in process_request
    if request.user.is_authenticated and not request.user.is_active:
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/auth/middleware.py", line 23, in __get__
    request._cached_user = get_user(request)
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/auth/__init__.py", line 111, in get_user
    username = request.session[SESSION_KEY]
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/contrib/sessions/backends/base.py", line 65, in __getitem__
    return self._session[key]
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/contrib/sessions/backends/base.py", line 238, in _get_session
    self._session_cache = self.load()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/contrib/sessions/backends/db.py", line 43, in load
    s = self._get_session_from_db()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/contrib/sessions/backends/db.py", line 34, in _get_session_from_db
    expire_date__gt=timezone.now()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 431, in get
    num = len(clone)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 262, in __len__
    self._fetch_all()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 1324, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 51, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/sql/compiler.py", line 1173, in execute_sql
    cursor = self.connection.cursor()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/base/base.py", line 259, in cursor
    return self._cursor()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/base/base.py", line 235, in _cursor
    self.ensure_connection()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/base/base.py", line 200, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/utils/asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/mysql/base.py", line 234, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/__init__.py", line 123, in Connect
    return Connection(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/connections.py", line 185, in __init__
    super().__init__(*args, **kwargs2)
django.db.utils.OperationalError: (1049, "Unknown database 'dtable_db'")

我直接将虚拟机恢复到之前正常状态的快照,重启后还是这个报错,是我的数据库有问题了吗

看起来是数据库的问题,dtable_db 未知数据库。你排查一下数据库是否正常运行,服务器和数据库是否正常连接?

请问这个数据是在哪里呢

我按照下面截图的方式操作对吗?

我做了seatable开启自动启动,发现只要重启或者使用命令systemctl restart/start seatable启动seatable就会出现这个问题,感觉是自动启动脚本有啥问题。

我关闭了自动启动,使用
docker-compose up -d
docker exec -d seatable /shared/seatable/scripts/seatable.sh start

是没问题的

如果你执行 start.sh start 脚本是正常的,那可能时重启或者自动启动脚本的问题(重启或者自动启动脚本执行时,没有正常启动 dtable-db 数据库,造成无法访问)那你重启后,看一下 dtable-db 是否启动,对应 dtable-db 的进程正常吗

请教一下,如何看dtable-db是否启动和对应dtable-db是否正常,谢谢!

你在 docker 内部执行 lsof -i | grep dtable-db 看一下 dtable-db 的服务是否启动就行

谢谢~
当前seatable是正常运行的,但我进mariadb里面执行命令发现没有输出,是我操作的不对吗

你在 seatable/seatable-developer:latest 这个容器中执行一下 lsof 命名
mariadb 是数据库