OperationalError: no such table: django_session

Hey,
I’m using seafile (6.0.7) on Ubuntu 16.04 LTS with apache 2.4 and a https proxy now a long time.
Today, I restarted my server and after booting and starting seafile I noticed that I don’t get the seahub interface when accessing the URL. SeafDAV works fine, but it seems like seahub doesn’t. It shows only a ‘Page unavailable’ site with no further details.
After a short investigation I saw a error output in the seahub_django_request.log
For every try to access seahub there was a error message that ended with OperationalError: no such table: django_session. The table wasn’t always django_session, depending on which site was accessed. The whole message when I try to access the seafile root:
2017-02-02 22:26:47,652 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: / Traceback (most recent call last): File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/core/handlers/base.py", line 108, in get_response response = middleware_method(request) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/middleware/locale.py", line 32, in process_request request, check_path=check_path) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-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 "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-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 "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/contrib/sessions/backends/base.py", line 59, in get return self._session.get(key, default) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/contrib/sessions/backends/base.py", line 181, in _get_session self._session_cache = self.load() File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/contrib/sessions/backends/db.py", line 21, in load expire_date__gt=timezone.now() File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/models/manager.py", line 127, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/models/query.py", line 328, in get num = len(clone) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/models/query.py", line 144, in __len__ self._fetch_all() File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/models/query.py", line 965, in _fetch_all self._result_cache = list(self.iterator()) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/models/query.py", line 238, in iterator results = compiler.execute_sql() File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/models/sql/compiler.py", line 840, in execute_sql cursor.execute(sql, params) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/utils.py", line 98, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-py2.7.egg/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/seafile/haiwen/seafile-server-6.0.7/seahub/thirdpart/Django-1.8.16-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
It seems like seahub didn’t found the django_session table but the table is there. When I log onto mysql with exactly the credentials from the seahub config I can access and read the table (and all other tables that produce these error messages).
In the mysql access log I found only a repetition of those commands:
2017-02-02T14:40:18.706795Z 6 Prepare SELECT 1 FROM Repo WHERE repo_id=? 2017-02-02T14:40:18.707355Z 6 Reset stmt 2017-02-02T14:40:18.707465Z 6 Close stmt 2017-02-02T14:40:18.707665Z 6 Prepare SELECT commit_id FROM Branch WHERE name='master' AND repo_id=? 2017-02-02T14:40:18.708040Z 6 Reset stmt 2017-02-02T14:40:18.708200Z 6 Close stmt 2017-02-02T14:40:18.713243Z 6 Prepare SELECT 1 FROM Repo WHERE repo_id=? 2017-02-02T14:40:18.713858Z 6 Reset stmt 2017-02-02T14:40:18.713969Z 6 Close stmt 2017-02-02T14:40:18.714162Z 6 Prepare SELECT commit_id FROM Branch WHERE name='master' AND repo_id=? 2017-02-02T14:40:18.714536Z 6 Reset stmt 2017-02-02T14:40:18.714706Z 6 Close stmt ...
The mysql error log says on every seafile startup:
2017-02-02T14:42:02.854122Z 253 [Note] Aborted connection 253 to db: 'seafile-db' user: 'seafile' host: 'localhost' (Got an error reading communication packets) 2017-02-02T14:42:03.017368Z 993 [Note] Aborted connection 993 to db: 'ccnet-db' user: 'seafile' host: 'localhost' (Got an error reading communication packets)
I looked at some reasons for the error while reading communication packets. I raised the global max_allowed_connections var and looked at the timeout vars but now, I don’t know what to do anymore.

I’ve just replaced my the seafile-server-6.0.7 folder with a fresh one from the download page and started the server manual via the user and not via the script I have to execute it as root (uses sudo to run the scripts as user seafile).
Now the server runs as usual. But when I try to run via the script that uses sudo the server starts but I get the same problem. Strange.