seatable / seatable

SeaTable: easy like a spreadsheet, powerful like a database. Unlimited rows in a single base.

Home Page:https://seatable.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQL not migrated to 1.8.0?

martinkoutecky opened this issue · comments

I was running Seatable 1.7 and everything was fine; today I did docker-compose pull, restarted, and now I can't open my base. It seems like MySQL wasn't correctly migrated and some column is missing. How can I fix this?

In dtable_web.log I see:

2021-03-22 06:18:10,767 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api/v2.1/workspaces/
Traceback (most recent call last):
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'dtable_view_user_share.shared_name' in 'field list'")

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

Traceback (most recent call last):
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/api2/endpoints/dtable.py", line 193, in get
    for view in shared_views_by_user:
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 250, in __iter__
    self._fetch_all()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 1121, 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 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/sql/compiler.py", line 889, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.OperationalError: (1054, "Unknown column 'dtable_view_user_share.shared_name' in 'field list'")

OK, I was missing this: upgrade database. Note that there is no space between the -p and the $DB_ROOT_PASSWD; this is important.