haiwen / seafile-docker

A Docker image for Seafile server
Other
544 stars 183 forks source link

MySQL connection lost and memcache exception #222

Closed r3361 closed 4 years ago

r3361 commented 4 years ago

When trying to upload ab bunch of small files (1.7GB, ~10.000 files) with desktop client. It suddenly stops and throws memcache and mysql errors. Webinterface is down aswell after receiving this errors.

/opt/seafile-data/seafile/logs/seafile.log

[05/13/2020 09:24:29 AM] start to serve on pipe client
[05/13/2020 09:24:29 AM] start to serve on pipe client
[05/13/2020 09:25:02 AM] start to serve on pipe client
[05/13/2020 09:33:12 AM] ../common/seaf-db.c(596): Failed to connect to MySQL: Can't connect to MySQL server on 'db' (110)
[05/13/2020 09:33:12 AM] filelock-mgr.c(1035): Failed to get OnlineOffice file locks
.[05/13/2020 09:34:13 AM] ../common/seaf-db.c(596): Failed to connect to MySQL: Can't connect to MySQL server on 'db' (110)
[05/13/2020 09:34:13 AM] filelock-mgr.c(1035): Failed to get OnlineOffice file locks
.[05/13/2020 09:35:14 AM] ../common/seaf-db.c(596): Failed to connect to MySQL: Can't connect to MySQL server on 'db' (110)
[05/13/2020 09:35:14 AM] filelock-mgr.c(1035): Failed to get OnlineOffice file locks
.[05/13/2020 09:36:15 AM] ../common/seaf-db.c(596): Failed to connect to MySQL: Can't connect to MySQL server on 'db' (110)
[05/13/2020 09:36:15 AM] filelock-mgr.c(1035): Failed to get OnlineOffice file locks
.[05/13/2020 09:37:16 AM] ../common/seaf-db.c(596): Failed to connect to MySQL: Can't connect to MySQL server on 'db' (110)
[05/13/2020 09:37:16 AM] filelock-mgr.c(1035): Failed to get OnlineOffice file locks

/opt/seafile-data/seafile/logs/seahub.log

2020-05-13 07:24:29,224 [INFO] seafes:162 load_seafevents_conf [seafes] use highlighter fvh
2020-05-13 07:24:29,227 [INFO] seafes:162 load_seafevents_conf [seafes] use highlighter fvh
2020-05-13 07:34:35,802 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /library/1a502f4c-61c9-4e4e-ac7c-72f74676d0b1/My Library/
Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/contrib/sessions/backends/base.py", line 202, in _get_session
    return self._session_cache
AttributeError: 'SessionStore' object has no attribute '_session_cache'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 583, in connect
    **kwargs)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/mysql/base.py", line 274, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 325, in __init__
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 630, in connect
    raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'db' (timed out)")

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

Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py", line 244, in _legacy_get_response
    response = middleware_method(request)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/middleware/locale.py", line 25, in process_request
    language = translation.get_language_from_request(request, check_path=i18n_patterns_used)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/utils/translation/__init__.py", line 211, in get_language_from_request
    return _trans.get_language_from_request(request, check_path)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/utils/translation/trans_real.py", line 519, in get_language_from_request
    lang_code = request.session.get(LANGUAGE_SESSION_KEY)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/contrib/sessions/backends/base.py", line 68, in get
    return self._session.get(key, default)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/contrib/sessions/backends/base.py", line 207, in _get_session
    self._session_cache = self.load()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/contrib/sessions/backends/db.py", line 35, in load
    expire_date__gt=timezone.now()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 374, in get
    num = len(clone)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 232, in __len__
    self._fetch_all()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/sql/compiler.py", line 887, in execute_sql
    cursor = self.connection.cursor()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 254, in cursor
    return self._cursor()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 229, in _cursor
    self.ensure_connection()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/mysql/base.py", line 274, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 325, in __init__
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 630, in connect
    raise exc
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'db' (timed out)")
2020-05-13 07:34:36,964 [ERROR] django.pylibmc:132 get MemcachedError: error 31 from memcached_get(:1:ENABLE_TERMS_AND_CONDITIONS): (0x363e600) A TIMEOUT OCCURRED,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.Error: error 31 from memcached_get(:1:ENABLE_TERMS_AND_CONDITIONS): (0x363e600) A TIMEOUT OCCURRED,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:34:36,986 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:autofilled): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:autofilled): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:34:51,005 [ERROR] django.pylibmc:167 set_many MemcachedError: error 47 from memcached_set_multi: (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY, memcached:11211,  host: memcached:11211 -> libmemcached/connect.cc:811
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 165, in set_many
    return super(PyLibMCCache, self).set_many(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 150, in set_many
    self._cache.set_multi(safe_data, self.get_backend_timeout(timeout))
pylibmc.ServerDown: error 47 from memcached_set_multi: (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY, memcached:11211,  host: memcached:11211 -> libmemcached/connect.cc:811
2020-05-13 07:34:51,020 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:ENABLE_TERMS_AND_CONDITIONS): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:ENABLE_TERMS_AND_CONDITIONS): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:35:05,044 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:35:05,058 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:autofilled): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:autofilled): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:35:19,087 [ERROR] django.pylibmc:167 set_many MemcachedError: error 47 from memcached_set_multi: (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY, memcached:11211,  host: memcached:11211 -> libmemcached/connect.cc:811
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 165, in set_many
    return super(PyLibMCCache, self).set_many(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 150, in set_many
    self._cache.set_multi(safe_data, self.get_backend_timeout(timeout))
pylibmc.ServerDown: error 47 from memcached_set_multi: (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY, memcached:11211,  host: memcached:11211 -> libmemcached/connect.cc:811
2020-05-13 07:35:19,101 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:35:33,125 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:35:33,140 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:autofilled): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:autofilled): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:35:47,164 [ERROR] django.pylibmc:167 set_many MemcachedError: error 47 from memcached_set_multi: (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY, memcached:11211,  host: memcached:11211 -> libmemcached/connect.cc:811
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 165, in set_many
    return super(PyLibMCCache, self).set_many(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 150, in set_many
    self._cache.set_multi(safe_data, self.get_backend_timeout(timeout))
pylibmc.ServerDown: error 47 from memcached_set_multi: (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY, memcached:11211,  host: memcached:11211 -> libmemcached/connect.cc:811
2020-05-13 07:35:47,178 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django_pylibmc/memcached.py", line 130, in get
    return super(PyLibMCCache, self).get(key, default, version)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/cache/backends/memcached.py", line 79, in get
    val = self._cache.get(key)
pylibmc.ServerDown: error 47 from memcached_get(:1:ENABLE_TWO_FACTOR_AUTH): (0x363e600) SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY,  host: memcached:11211 -> libmemcached/get.cc:314
2020-05-13 07:36:07,205 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/
Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 583, in connect
    **kwargs)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/mysql/base.py", line 274, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 325, in __init__
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 630, in connect
    raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'db' (timed out)")

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

Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/views.py", line 493, in dispatch
    self.initial(request, *args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/views.py", line 410, in initial
    self.perform_authentication(request)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/views.py", line 324, in perform_authentication
    request.user
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/request.py", line 220, in user
    self._authenticate()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/rest_framework/request.py", line 373, in _authenticate
    user_auth_tuple = authenticator.authenticate(self)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/seahub/api2/authentication.py", line 65, in authenticate
    ret = self.authenticate_v2(request, key)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/seahub/api2/authentication.py", line 92, in authenticate_v2
    token = TokenV2.objects.get(key=key)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 374, in get
    num = len(clone)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 232, in __len__
    self._fetch_all()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/models/sql/compiler.py", line 887, in execute_sql
    cursor = self.connection.cursor()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 254, in cursor
    return self._cursor()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 229, in _cursor
    self.ensure_connection()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/django/db/backends/mysql/base.py", line 274, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 325, in __init__
    self.connect()
  File "/opt/seafile/seafile-pro-server-7.1.3/seahub/thirdpart/pymysql/connections.py", line 630, in connect
    raise exc
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'db' (timed out)")

docker-compose.yml

version: '2.0'
services:
  db:
    image: mariadb:10.1
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=REDACTED
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /opt/seafile-mysql/db:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net

  elasticsearch:
    image: seafileltd/elasticsearch-with-ik:5.6.16
    container_name: seafile-elasticsearch
    environment:
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 4g
    volumes:
      - /opt/seafile-elasticsearch/data:/usr/share/elasticsearch/data  # Requested, specifies the path to Elasticsearch data persistent store.
    networks:
      - seafile-net

  seafile:
    image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
    container_name: seafile
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /opt/seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=REDACTED
      - SEAFILE_ADMIN_EMAIL=example@domain.tld
      - SEAFILE_ADMIN_PASSWORD=REDACTED
      - SEAFILE_SERVER_LETSENCRYPT=true
      - SEAFILE_SERVER_HOSTNAME=domain.tld
    depends_on:
      - db
      - memcached
      - elasticsearch
    networks:
      - seafile-net

networks:
  seafile-net:
r3361 commented 4 years ago

short update, even if I leave seafile untouched, no sync and no upload, it suddenly stops working with the above error message.

I tried with a newer version of memcached and mariadb, but still got the same error.

I also tried to run the community edition, same error as above.