Unable to load base view after 2.0.0 upgrade

My sealfhosted Seatable was working fine at version 1.8.0. After upgrading from 1.8.0 to 2.0.0 seafile shows a client side error 500 (for route api/v2.1/workspaces/) when loading base view

dtable_web.log states

2021-05-28 13:03:32,366 [ERROR] seahub.api2.endpoints.dtable:154 get (1146, "Table 'dtable_db.folders' doesn't exist")
2021-05-28 13:03:32,367 [ERROR] django.request:228 log_response Internal Server Error: /api/v2.1/workspaces/

also loading “Gemeinsamer Datensatz” (api/v2.1/dtable/common-datasets/?by_group=truefails with erro 500

dtable_web.log:

2021-05-28 13:09:03,549 [ERROR] django.request:228 log_response Internal Server Error: /api/v2.1/dtable/common-datasets/
Traceback (most recent call last):
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/mysql/base.py", line 71, in execute
    return self.cursor.execute(query, args)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/connections.py", line 259, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'dtable_common_dataset.group_id' 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 34, in inner
    response = get_response(request)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/core/handlers/base.py", line 115, 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 113, 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 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/api2/endpoints/dtable_common_dataset.py", line 68, in get
    available_sets = [dataset for dataset in datasets if dataset.can_access_by_user_through_group(username)]
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 274, in __iter__
    self._fetch_all()
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/models/query.py", line 1242, 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 55, 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 1142, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/django/db/backends/mysql/base.py", line 71, in execute
    return self.cursor.execute(query, args)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/opt/seatable/seatable-server-latest/dtable-web/thirdpart/MySQLdb/connections.py", line 259, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1054, "Unknown column 'dtable_common_dataset.group_id' in 'field list'")

My upgrade procedure was:

  • down-compose down
  • edit image tag in docker-compose.yml to 2.0.0
  • docker-compose pull
  • docker-compose up and wait for This is a idle script (infinite loop) to keep container running.
  • docker-compose up -d
  • docker exec -d seatable /shared/seatable/scripts/seatable.sh start

Hi, did you follow the steps in the manual?
Upgrade manual - SeaTable Admin Manual

And the latest docker image is 2.0.5, I don’t think you have to change the tag in the yml file, if it is “latest”. But I’m not sure if this is the cause.

1 Like

You just repeated the installation procedure.

Please read the upgrade instructions carefully! You cannot expect the version change to work if you don’t do what is necessary.

Specifically, you need to run the database upgrade scripts.

@Karlheinz, @rdb As always, incredible fast support. Thank you! And also thank you for the awesome new features in 2.0.0. I’m quite excited to try them out.

And the latest docker image is 2.0.5, I don’t think you have to change the tag in the yml file, if it is “latest”. But I’m not sure if this is the cause.

Where can I find version 2.0.5? The last released tag on dockerhub is 2.0.0 (released to days ago).
BTW: I prefer having sticky image versions (rather than trailing tags) in docker-compose.ymls as they make moving things from host to host and folder backups much more reliable.

Please read the upgrade instructions carefully! You cannot expect the version change to work if you don’t do what is necessary.

@rdb You’re absolutely right. That was my fault. But while we are on the topic of expectations: It is quite rare in modern docker deployments for the user to have to go through a separate upgrade routine and exec into the container to start a database migration. Plenty of docker deployments handle the upgrade process at some point during their startup, e.g. wordpress, nextcloud, rocketchat, jitsi, bigbluebutton, onlyoffice und many more. Expecting the user to know (or assume), that they are required to diverge from common upgrade routines could be considered presumptuous. Especially when there is little to no reference to it in the usual places, were one would expect to find something on that topic.

@rdb Reading between the lines, I got the feeling, that me failing to know the upgrade procedure somehow got you agitated. I’m sorry about that. Please take my above comment as more of a suggestion for improvement rather than a criticism.

Sorry I was talking about the Enterprise Edition. If you are using Developer Edition, then the latest is 2.0.0!

P.S. - The Enterprise Edition is free if your team is not larger than 3 users.
seatable/seatable-ee Tags (docker.com)

1 Like

@happy The award for the nicest user definitely goes to you!

Thanks for your concern about upsetting me. I am not. (Though I was confused. Isn’t the manual the natural place to look for instructions? And contrary to what you say, there is a section dedicated to the upgrade topic.)

When it comes to your comments, I hear them! We’ll optimize our Docker deployment. There is room for improvement. But it’s not a top priority of ours, given it works pretty well.

Finally, did you succeed in upgrading to SeaTable 2.0? Do you need more help?

1 Like

Yes, after the proper steps (meaning the database migration) it worked flawlessly. Thank you.

And I agree, the manual is the right place for those instructions. I guess my point was: If one doesn’t expect there to be a manual upgrade procedure, because it isn’t referenced/mentioned in places where it usually is (update nodes, release notes, installation notes), one does not tend to read the entire manual beforehand. But maybe I’m just a bit spoiled by convenience ^^

Glad to hear that it worked eventually. I will mark the topic as solved.

We’ll discuss internally what we can do to point out more clearly that the migration requires some manual steps.

1 Like

I agree, the database upgrade should either be automated or mentioned more explicitly.
I’ve been stuck 2 or 3 times after upgrading, until I thought about that thing to do