Open phiradd opened 1 month ago
Hello @phiradd , can you show the seahub.log and seafile.log from the seafile server when the account was deleted?
@feiniks Sure. Here are the log entry snippets around that time. Thanks for your help.
Seahub.log
2024-09-09 01:07:21,904 [WARNING] django.request:241 log_response Unauthorized: /api2/auth/ping/
2024-09-09 01:07:38,422 [ERROR] django.request:241 log_response Internal Server Error: /api2/account/info/
Traceback (most recent call last):
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/seafile/seafile-server-11.0.12/seahub/seahub/api2/base.py", line 23, in dispatch
response = super(APIView, self).dispatch(*a, **kw)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/opt/seafile/seafile-server-11.0.12/seahub/seahub/api2/base.py", line 20, in handle_exception
return super(APIView, self).handle_exception(exc)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/views.py", line 497, in dispatch
self.initial(request, *args, **kwargs)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/views.py", line 414, in initial
self.perform_authentication(request)
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/views.py", line 324, in perform_authentication
request.user
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/request.py", line 227, in user
self._authenticate()
File "/opt/seafile/seafile-server-11.0.12/seahub/thirdpart/rest_framework/request.py", line 380, in _authenticate
user_auth_tuple = authenticator.authenticate(self)
File "/opt/seafile/seafile-server-11.0.12/seahub/seahub/api2/authentication.py", line 67, in authenticate
ret = self.authenticate_v2(request, key)
File "/opt/seafile/seafile-server-11.0.12/seahub/seahub/api2/authentication.py", line 103, in authenticate_v2
user = User.objects.get(email=token.user)
File "/opt/seafile/seafile-server-11.0.12/seahub/seahub/base/accounts.py", line 280, in get
emailuser = ccnet_threaded_rpc.get_emailuser(email)
File "/opt/seafile/seafile-server-11.0.12/seafile/lib/python3/site-packages/pysearpc/client.py", line 125, in newfunc
ret_str = self.call_remote_func_sync(fcall_str)
File "/opt/seafile/seafile-server-11.0.12/seafile/lib/python3/site-packages/pysearpc/named_pipe.py", line 98, in call_remote_func_sync
ret_str = transport.send(self.service_name, fcall_str)
File "/opt/seafile/seafile-server-11.0.12/seafile/lib/python3/site-packages/pysearpc/named_pipe.py", line 62, in send
resp_header = recvall(self.pipe, 4)
File "/opt/seafile/seafile-server-11.0.12/seafile/lib/python3/site-packages/pysearpc/utils.py", line 17, in recvall
raise NetworkError("Failed to read from socket")
pysearpc.errors.NetworkError: Failed to read from socket
seafile.log
2024-09-09 01:06:22 ../common/seaf-db.c(867): Failed to connect to MySQL: Unknown server host 'db' (-3)
2024-09-09 01:06:23 http-server.c(2714): DB error when get accessible repo list.
2024-09-09 01:06:35 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'handshake: reading initial communication packet', system error: 110
2024-09-09 01:07:00 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'handshake: reading initial communication packet', system error: 110
2024-09-09 01:07:01 http-server.c(2714): DB error when get accessible repo list.
2024-09-09 01:07:12 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'reading authorization packet', system error: 110
2024-09-09 01:07:12 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'reading authorization packet', system error: 110
2024-09-09 01:07:13 repo-mgr.c(3810): Failed to add branch.
2024-09-09 01:07:13 http-server.c(2714): DB error when get accessible repo list.
2024-09-09 01:07:15 seafile-session.c(631): Failed to create system default repo.
2024-09-09 01:07:15 start to serve on pipe client
2024-09-09 01:07:15 start to serve on pipe client
2024-09-09 01:07:19 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'handshake: reading initial communication packet', system error: 110
2024-09-09 01:07:20 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'handshake: reading initial communication packet', system error: 110
2024-09-09 01:07:21 ../common/seaf-db.c(867): Failed to connect to MySQL: Lost connection to server at 'handshake: reading initial communication packet', system error: 110
2024-09-09 01:07:35 ../common/seaf-db.c(928): Failed to prepare sql SELECT e.id, e.email, is_staff, is_active, ctime, passwd, reference_id, role FROM EmailUser e LEFT JOIN UserRole ON e.email = UserRole.email WHERE e.email=?: Lost connection to server during query
2024-09-09 01:07:37 ../common/seaf-db.c(501): The mysql connection has expired, creating a new connection to re-query.
2024-09-09 01:10:47 seafile-session.c(65): fileserver: web_token_expire_time = 3600
2024-09-09 01:10:47 seafile-session.c(65): fileserver: web_token_expire_time = 3600
2024-09-09 01:10:48 seafile-session.c(77): fileserver: max_index_processing_threads= 3
2024-09-09 01:10:48 seafile-session.c(77): fileserver: max_index_processing_threads= 3
Hello @phiradd , based on the logs, it seems this error occurred due to a database disconnection. Since the database could not be reached, the system was unable to verify the user's existence, resulting in a 401 response. The failure to connect to the database was likely caused by the NAS being unreachable, preventing MySQL from reading the local data. However, a 401 response may not be appropriate in this case, and we will look into optimizing this issue.
@feiniks Thank you very much for your insights. The db runs on the same NAS as the seafile server. Admittedly, there is probably too much running on the NAS, such that the db did not respond in time for the request as the NAS was busy with other stuff. I will upgrade the NAS eventually. Is there a config where I can increase the timeout for the database connection to make it more likely that this issue does not come up that often?
Hello @phiradd, the client timeout for MySQL is set to the default and cannot be configured.
I have got a seafile server running in a docker container on a QNAP NAS with the default configuration files (I have not changed any settings yet). It works very well but I have an issue whenever the NAS is not reachable, the account is removed from Seafile Drive Client 3.0.10 on Windows 10, so that I have to relogin and put in all data for that. That is really annyoing. (It is only available in my local network).
Is there any way not to remove the account and just reconnect on server availability? I could not find anything in the configs.
I have changed some sensitive pw/paths in the logs/docker-compose. Please let me know if you need any other logs/config/info.
Thank you for your help!
seadrive-gui.log
docker-compose.yml