Seafile client doesn't connect to server

Hi Forum,

I’m Daniel and a seafile newbie. I’ve installed the Seafile Server 7.1.4 (Pro) on Ubuntu 18.04 and follows these installation and config guide from Datamate >> YouTube >> -YrY2Ps03sE

So far so good. The SF Server is running well and the Webinterface is fast.
Now I’ll connect with the Client on Mac OS X to the server. This is currently not possible.
I got the popup “Login Error: Internal Server Error” (“Fehler beim Anmelden: Interner Serverfehler”).

Bildschirmfoto

A login via iOS app is not possible too.

In the past (1 year ago) I had an SF installation and it works fine. But now. No chance to connect.

Do you have an idea to make a connection possible?

Some sourounding information:

  • Seafile Server Pro 7.1.4
  • Ubuntu 18.04
  • nginx
  • mysql
  • lets encrypt
  • jail2ban
  • ufw

netstat -tulpn
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 8146/python3
tcp 0 0 127.0.0.1:6000 0.0.0.0:* LISTEN 8197/python3
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN 8069/ccnet-server
tcp 0 0 127.0.0.1:8082 0.0.0.0:* LISTEN 8068/seaf-server

Maybe a port is blocked or a service is not running? I don’t know.

Many thanks
Daniel

I don’t speak German, but I watched the Datamate video… The version he detailed was version 7.0.X. 7.1.X has different dependencies, particularly Python. It uses Python 3. He only detailed how to install Python 2. That may be where your problem lies. See the Prerequisites section of the manual for what is required by 7.1.X… https://download.seafile.com/published/seafile-manual/deploy/using_mysql.md

The next step would be to check your Seafile server log files for errors. There are several you can check. They will give you an indication as to where the problem lies. Also, get the nginx log file to see if there are any errors there as well.

Additionally, did you do anything special, such as use alternate port numbers?

Was it able to sync before you installed an ssl cert? How about before you installed nginx?

Hi wthess

thanks for your reply. I’ve installed python3 and SF is running with it. So far so fine.
I’ve checked the log files and I found the following entries in the seahub.access.log

  • 31.18.23.123 [27/May/2020:21:07:19 +0000] “POST /api2/auth-token/ HTTP/1.1” 200 52 “-” “Mozilla/5.0” 0.016
  • 31.18.23.123 [27/May/2020:21:07:19 +0000] “GET /api2/account/info/ HTTP/1.1” 500 285 “-” “Mozilla/5.0” 0.040

And the seahub.log gave me this output:

2020-05-27 23:14:52,445 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/account/info/
Traceback (most recent call last):
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/views.py", line 493, in dispatch
    self.initial(request, *args, **kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/views.py", line 410, in initial
    self.perform_authentication(request)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/views.py", line 324, in perform_authentication
    request.user
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/request.py", line 220, in user
    self._authenticate()
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/request.py", line 373, in _authenticate
    user_auth_tuple = authenticator.authenticate(self)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/authentication.py", line 65, in authenticate
    ret = self.authenticate_v2(request, key)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/authentication.py", line 129, in authenticate_v2
    if not within_time_range(token.last_accessed, datetime.datetime.now(), 10 * 60):
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/utils/__init__.py", line 1330, in within_time_range
    delta = d2 - d1 if d2 > d1 else d1 - d2
TypeError: can't compare offset-naive and offset-aware datetimes

I think this is the problem. But I can’t see what it means.

All other log files like nginx: access.log/error.log looks fine so far.
No further entries after trying to login in:
seafdav.access.log
seahub.error.log
seafhttp.access.log

Thanks
Daniel

1 Like

Sorry for the long delay… I’ve been swamped at work…

OK, so, the first entry, the “200” means successful with the POST. The next entry, “500” means internal service error with the GET…

However, the times on the entries you posted do not match between the seahub.access.log and the seahub.log. There is a 2 hour and 7 minute difference between the two, and the django is reporting a discrepancy in the times…, which could be the reason for the exception. Can you confirm that the time on your server is the same time that is on the client computer?

Again, I’m not well versed on DJango, but following the traceback, the only thing mentioned is authentication and the time offset.