Upgrade 6.1.1 -> 6.2.2 Seahub fails

Hi,

have upgraded from ver. 6.1.1 to 6.2.2 as described, configured changes (WSGI) on CentOS 7.4 and services restarted fine.

Now I get an error on web page:

Page unavailable

Sorry, but the requested page is unavailable due to a server hiccup.

Our engineers have been notified, so check back later.    

with these in /opt/seafile-server/logs/seahub_django_request.log:

2017-11-04 23:04:35,153 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /seafile/
Traceback (most recent call last):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py", line 108, in get_response
    response = middleware_method(request)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/seahub/base/middleware.py", line 69, in process_request
    self.get_from_db()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/seahub/base/middleware.py", line 53, in get_from_db
    refresh_cache()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/seahub/notifications/utils.py", line 11, in refresh_cache
    NOTIFICATION_CACHE_TIMEOUT)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/cache/backends/filebased.py", line 58, in set
    f.write(zlib.compress(pickle.dumps(value), -1))
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 135, in __reduce__
    return super(QuerySet, self).__reduce__()
  File "/usr/lib64/python2.7/copy_reg.py", line 84, in _reduce_ex
    dict = getstate()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 95, in __getstate__
    self._fetch_all()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such table: notifications_notification

Android Client fails too (internal server error) with these in /opt/seafile-server/logs/seahub_django_request.log:

2017-11-04 23:06:19,892 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /seafile/api2/server-info/
Traceback (most recent call last):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py", line 108, in get_response
    response = middleware_method(request)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/seahub/two_factor/middleware.py", line 30, in process_request
    if not config.ENABLE_TWO_FACTOR_AUTH:
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/utils/functional.py", line 225, in inner
    self._setup()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/__init__.py", line 11, in _setup
    self._wrapped = Config()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/base.py", line 10, in __init__
    utils.import_module_attr(settings.BACKEND)())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 37, in __init__
    self.autofill()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 52, in autofill
    for key, value in self.mget(settings.CONFIG.keys()):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 61, in mget
    for const in stored:
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such table: constance_config
2017-11-04 23:06:19,920 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /seafile/api2/repos/
Traceback (most recent call last):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py", line 108, in get_response
    response = middleware_method(request)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/seahub/two_factor/middleware.py", line 30, in process_request
    if not config.ENABLE_TWO_FACTOR_AUTH:
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/utils/functional.py", line 225, in inner
    self._setup()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/__init__.py", line 11, in _setup
    self._wrapped = Config()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/base.py", line 10, in __init__
    utils.import_module_attr(settings.BACKEND)())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 37, in __init__
    self.autofill()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 52, in autofill
    for key, value in self.mget(settings.CONFIG.keys()):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 61, in mget
    for const in stored:
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such table: constance_config
2017-11-04 23:06:19,920 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /seafile/api2/starredfiles/
Traceback (most recent call last):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py", line 108, in get_response
    response = middleware_method(request)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/seahub/two_factor/middleware.py", line 30, in process_request
    if not config.ENABLE_TWO_FACTOR_AUTH:
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/utils/functional.py", line 225, in inner
    self._setup()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/__init__.py", line 11, in _setup
    self._wrapped = Config()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/base.py", line 10, in __init__
    utils.import_module_attr(settings.BACKEND)())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 37, in __init__
    self.autofill()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 52, in autofill
    for key, value in self.mget(settings.CONFIG.keys()):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/django_constance-1.0.1-py2.6.egg/constance/backends/database/__init__.py", line 61, in mget
    for const in stored:
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such table: constance_config

MySQL tables looks as it should, double checked the statements in upgrade folder.

rm -rf /tmp/seahub_cache/

or

echo flush_all | nc localhost 11211

doesn’t helped…

WebDAV works fine!

Any hints for me?

It pretty much looks like you didn’t run all upgrade scripts.

There is only one: upgrade/upgrade_6.1_6.2.sh and it runs successfully with all db upgrades…

My seafile server installation/update history:

6.0.7 -> 6.1.1 -> 6.2.2

no search results for missed tables from above:

grep -rnw '/opt/seafile-server/seafile-server-6.?.?/upgrade/' -e 'notification'
grep -rnw '/opt/seafile-server/seafile-server-6.?.?/upgrade/' -e 'constance'

@daniel.pan looks like there is a bug.

let’s debug…

first step, back to fastcgi: it works!

It seems to be WSGI related?

But wait, after this run WSGI works too now!?
Have to check my systemd scripts…

Will be back!

@daniel.pan

Ok, my start scripts via systemd looks exactly like this:

Start Seafile at System Bootup

and working at itself as it should and ‘systemctl status’ for seaflie and seahub are fine and keep it after restarts:

?>systemctl status seahub-server.service 
● seahub-server.service - Seafile Seahub
   Loaded: loaded (/etc/systemd/system/seahub-server.service; enabled; vendor preset: disabled)
   Active: active (exited) since Thu 2017-11-09 18:08:48 CET; 4s ago
  Process: 2453 ExecStop=/opt/seafile-server/seafile-server-latest/seahub.sh stop (code=exited, status=0/SUCCESS)
  Process: 2514 ExecStart=/opt/seafile-server/seafile-server-latest/seahub.sh start (code=exited, status=0/SUCCESS)
 Main PID: 2514 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/seahub-server.service
           ├─2532 python2.7 /opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/gunicorn seahub.wsgi:application -c /opt/seafile-server/seafile-server-6.2.2/runtime/seahub.conf -b 0.0.0.0:8000 --preload
           ├─2542 python2.7 /opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/gunicorn seahub.wsgi:application -c /opt/seafile-server/seafile-server-6.2.2/runtime/seahub.conf -b 0.0.0.0:8000 --preload
           ├─2543 python2.7 /opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/gunicorn seahub.wsgi:application -c /opt/seafile-server/seafile-server-6.2.2/runtime/seahub.conf -b 0.0.0.0:8000 --preload
           └─2544 python2.7 /opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/gunicorn seahub.wsgi:application -c /opt/seafile-server/seafile-server-6.2.2/runtime/seahub.conf -b 0.0.0.0:8000 --preload

Nov 09 18:08:43 host.domain.org systemd[1]: Starting Seafile Seahub...
Nov 09 18:08:43 host.domain.org seahub.sh[2514]: LC_ALL is not set in ENV, set to en_US.UTF-8
Nov 09 18:08:43 host.domain.org seahub.sh[2514]: Starting seahub at port 8000 ...
Nov 09 18:08:48 host.domain.org systemd[1]: Started Seafile Seahub.



?>systemctl status seafile-server.service 
● seafile-server.service - Seafile Server
   Loaded: loaded (/etc/systemd/system/seafile-server.service; enabled; vendor preset: disabled)
   Active: active (exited) since Thu 2017-11-09 18:08:43 CET; 13s ago
  Process: 2434 ExecStop=/opt/seafile-server/seafile-server-latest/seafile.sh stop (code=exited, status=0/SUCCESS)
  Process: 2467 ExecStart=/opt/seafile-server/seafile-server-latest/seafile.sh start (code=exited, status=0/SUCCESS)
 Main PID: 2467 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/seafile-server.service
           ├─2490 /opt/seafile-server/seafile-server-6.2.2/seafile/bin/seafile-controller -c /opt/seafile-server/ccnet -d /opt/seafile-server/seafile-data -F /opt/seafile-server/conf
           ├─2492 ccnet-server -F /opt/seafile-server/conf -c /opt/seafile-server/ccnet -f /opt/seafile-server/logs/ccnet.log -d -P /opt/seafile-server/pids/ccnet.pid
           └─2494 seaf-server -F /opt/seafile-server/conf -c /opt/seafile-server/ccnet -d /opt/seafile-server/seafile-data -l /opt/seafile-server/logs/seafile.log -P /opt/seafile-server/pids/seaf-server.pid

Nov 09 18:08:39 host.domain.org systemd[1]: Starting Seafile Server...
Nov 09 18:08:40 host.domain.org seafile.sh[2467]: [11/09/17 18:08:40] ../common/session.c(132): using config file /opt/seafile-server/conf/ccnet.conf
Nov 09 18:08:40 host.domain.org seafile.sh[2467]: Starting seafile server, please wait ...
Nov 09 18:08:43 host.domain.org systemd[1]: Started Seafile Server.

But I still have the issue from above…

Meanwhile with this in /opt/seafile-server/logs/seahub_django_request.log for web page access:

2017-11-09 17:09:50,067 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /seafile/accounts/login/
Traceback (most recent call last):
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py", line 108, in get_response
    response = middleware_method(request)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/middleware/locale.py", line 32, in process_request
    request, check_path=check_path)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/utils/translation/__init__.py", line 198, in get_language_from_request
    return _trans.get_language_from_request(request, check_path)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/utils/translation/trans_real.py", line 503, in get_language_from_request
    lang_code = request.session.get(LANGUAGE_SESSION_KEY)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/contrib/sessions/backends/base.py", line 59, in get
    return self._session.get(key, default)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/contrib/sessions/backends/base.py", line 181, in _get_session
    self._session_cache = self.load()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/contrib/sessions/backends/db.py", line 21, in load
    expire_date__gt=timezone.now()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 328, in get
    num = len(clone)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 144, in __len__
    self._fetch_all()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile-server/seafile-server-6.2.2/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such table: django_session

If I do it manually:

?>systemctl stop seahub.service
?>./seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …

Seahub is started

Done.

Seahub is working fine for web page and Android Client with no log entries…!?!

Any hints for me?

Provide please your service configuration file and check if table django_session is in your seafile database

Yes, django_session is in seahub-db with data: session_key, session_data and expire_date

Which configuration file do you mean exactly?

/etc/systemd/system/seafile.service
/etc/systemd/system/seahub.service

/etc/systemd/system/seafile-server.service:

[Unit]
Description=Seafile Server
After=network.target mariadb.service
 
[Service]
Type=oneshot
ExecStart=/opt/seafile-server/seafile-server-latest/seafile.sh start
ExecStop=/opt/seafile-server/seafile-server-latest/seafile.sh stop
RemainAfterExit=yes
User=seafile
Group=seafile
 
[Install]
WantedBy=multi-user.target

/etc/systemd/system/seahub-server.service:

[Unit]
Description=Seafile Seahub
After=network.target seafile-server.service
 
[Service]
# change start to start-fastcgi if you want to run fastcgi
ExecStart=/opt/seafile-server/seafile-server-latest/seahub.sh start
ExecStop=/opt/seafile-server/seafile-server-latest/seahub.sh stop
User=seafile
Group=seafile
Type=oneshot
RemainAfterExit=yes
 
[Install]
WantedBy=multi-user.target

Can you please try to change User and Group to root for test? Just for check if you seafile user and group don’t have messed up some permissions. In systemd service configs for both seafile and seahub.

Yes, it works for user and group ‘root’ in seahub-server.service.

After the Upgrade(s) and several times after current behaviour I’m setting:

chown -R seafile:seafile /opt/seafile-server/seafile-server-6.2.2

with no effect, as you know.

Currently log file is missing (as above):

OperationalError: no such table: notifications_notification

With a glimpse it looks like mysql privilege issue, but this permission is given by conf/seahub_settings.py for sure and mysql-db privileges are fine for db-user seafile.

Damn…

Running this solved the problem!

chown -R seafile:seafile /opt/seafile-server/

and that means we have had some ownerchip changes by upgrade_script in higher subdirectories…

tree -L 1 /opt/seafile-server/
.
├── ccnet
├── conf
├── installed
├── logs
├── pids
├── seafile-data
├── seafile-server-6.0.7
├── seafile-server-6.1.1
├── seafile-server-6.2.2
├── seafile-server-latest -> seafile-server-6.2.2
└── seahub-data

Thanks for your support!

Is it worth to add chown command to upgrade tutorial, because the seafile-server_version_x86-64.tar.gz default user and group is 500?

Better run

chown -R seafile:seafile /opt/seafile-server

mmh… yes. :wink: