Seahub 12.0.14 Server error while trying to generate a share link

While trying to generate a share link to a folder in my self-hosted Seafile, I get an “Error” popup with no further information. The seahub log shows the traceback below.

I recently upgrade from version 10 to 12.0.14, and at the same time converted from SQLite to MySQL. Did something go wrong in the database conversion?

[2025-08-26 15:14:33] [ERROR] django.request:241 log_response Internal Server Error: /api/v2.1/multi-share-links/
Traceback (most recent call last):
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/mysql/base.py", line 75, in execute
    return self.cursor.execute(query, args)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 320, in _query
    self._do_get_result(db)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 145, in _do_get_result
    self._result = result = self._get_result()
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 352, in _get_result
    return self._get_db().store_result()
MySQLdb.DataError: (1406, "Data too long for column 'token' at row 1")

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

Traceback (most recent call last):
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/share/decorators.py", line 128, in _decorated
    return func(view, request, *args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/api2/endpoints/multi_share_links.py", line 257, in post
    fs = FileShare.objects.create_dir_link(username, repo_id, path,
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/share/models.py", line 208, in create_dir_link
    return self._add_file_share(username, repo_id, path, 'd', password,
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/share/models.py", line 150, in _add_file_share
    fs = super(FileShareManager, self).create(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/query.py", line 658, in create
    obj.save(force_insert=True, using=self.db)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/base.py", line 814, in save
    self.save_base(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/base.py", line 877, in save_base
    updated = self._save_table(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/base.py", line 1020, in _save_table
    results = self._do_insert(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/base.py", line 1061, in _do_insert
    return manager._insert(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/query.py", line 1805, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/sql/compiler.py", line 1822, in execute_sql
    cursor.execute(sql, params)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/mysql/base.py", line 75, in execute
    return self.cursor.execute(query, args)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 320, in _query
    self._do_get_result(db)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 145, in _do_get_result
    self._result = result = self._get_result()
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 352, in _get_result
    return self._get_db().store_result()
django.db.utils.DataError: (1406, "Data too long for column 'token' at row 1")

A possibly related traceback, when clicking on the “share” icon for a file. The final line

"Unknown column 'base_filecomment.uuid_id'

suggests that something went wrong during conversion of the database (missing column). But what, and how can I fix this?

[2025-08-27 07:44:25] [ERROR] django.request:241 log_response Internal Server Error: /api2/repos/fe89830d-81e8-4297-ae99-fdf97fb0256e/file/detail/
Traceback (most recent call last):
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/mysql/base.py", line 75, in execute
    return self.cursor.execute(query, args)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/connections.py", line 254, in query
    _mysql.connection.query(self, query)
MySQLdb.OperationalError: (1054, "Unknown column 'base_filecomment.uuid_id' in 'WHERE'")

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

Traceback (most recent call last):
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/seahub/api2/views.py", line 3416, in get
    comment_total = file_comments.count()
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/query.py", line 608, in count
    return self.query.get_count(using=self.db)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/sql/query.py", line 568, in get_count
    return obj.get_aggregation(using, {"__count": Count("*")})["__count"]
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/sql/query.py", line 554, in get_aggregation
    result = compiler.execute_sql(SINGLE)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/home/seafile/seafile/seafile-server-12.0.14/seahub/thirdpart/django/db/backends/mysql/base.py", line 75, in execute
    return self.cursor.execute(query, args)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/home/seafile/env/lib/python3.10/site-packages/MySQLdb/connections.py", line 254, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1054, "Unknown column 'base_filecomment.uuid_id' in 'WHERE'")


It seems that some SQL tables are not correct after you migrate from SQLite to MySQL.

You can find the correct version of MySQL tables at:

You can compare the SQL tables and fix them manually.

I (finally) had a look at the sql code you linked and compared to my databases. The differences are significant. I am not a database expert, let alone an expert in seafile databases.

I ran the three sql script, one for each database, in the context of the appropriate database. This has created the required tables, but did not fix the problem.

I am not sure what to do next. I don’t have the time to dive into seafile code to figure out what goes wrong. So I am considering to reinstall everything, which will seriously inconvenience all users, as they will have to recreate their databases and settings. Or maybe I will just have to accept that share link generation doesn’t work; it would be a pity, but maybe unavoidable.

Any suggestions are very welcome.