Base-Overview throws Error after Update to SeaTable 4.2 if department function was activated before

Dear SeaTable Admins,

The problem:

Do you run your own SeaTable Server and after an update to version 4.2 you only get an “Error” on the homepage of SeaTable?

image

Then it might be the problem, that you activated departments anytime in the past, and now you have this configuration problem.

Look for the errors:

Open the dtable_web.log with, for example the command fail -f dtable_web.log and see if this error occurs if you open the homepage of SeaTable with your browser. If you see this error message, your ran into this problem:

2023-11-23 13:23:06,659 [ERROR] django.request:224 log_response Internal Server Error: /api/v2.1/workspaces/
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/core/handlers/base.py", line 181, 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 70, 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.py", line 128, in get
    department_v2_groups = get_department_v2_groups_by_user(username).select_related('department')
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/department_v2/utils.py", line 20, in get_department_v2_groups_by_user
    for department_id in DepartmentsV2.objects.get_ancestor_departments_ids(department):
  File "/opt/seatable/seatable-server-latest/dtable-web/seahub/department_v2/models.py", line 19, in get_ancestor_departments_ids
    for dep_id in department.path.strip('/').split('/'):
AttributeError: 'NoneType' object has no attribute 'strip'

The solution

Open your dtable_web_settings.py and comment or remove these two entries.

DISABLE_ADDRESSBOOK_V1 = True
ENABLE_ADDRESSBOOK_V2 = True

Alternatively, you can set both values to False.

Then restart SeaTable with seatable.sh restart and the problem will be resolved.

1 Like