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”).


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* LISTEN -
tcp 0 0* LISTEN -
tcp 0 0* LISTEN 8146/python3
tcp 0 0* LISTEN 8197/python3
tcp 0 0* LISTEN -
tcp 0 0* LISTEN 8069/ccnet-server
tcp 0 0* LISTEN 8068/seaf-server

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

Many thanks

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…

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

  • [27/May/2020:21:07:19 +0000] “POST /api2/auth-token/ HTTP/1.1” 200 52 “-” “Mozilla/5.0” 0.016
  • [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/", line 41, in inner
    response = get_response(request)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/core/handlers/", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/core/handlers/", 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/", 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/", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/django/views/generic/", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 465, in handle_exception
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 476, in raise_uncaught_exception
    raise exc
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 493, in dispatch
    self.initial(request, *args, **kwargs)
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 410, in initial
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 324, in perform_authentication
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 220, in user
  File "/srv/seafile-pro-server-7.1.4/seahub/thirdpart/rest_framework/", line 373, in _authenticate
    user_auth_tuple = authenticator.authenticate(self)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/", line 65, in authenticate
    ret = self.authenticate_v2(request, key)
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/api2/", line 129, in authenticate_v2
    if not within_time_range(token.last_accessed,, 10 * 60):
  File "/srv/seafile-pro-server-7.1.4/seahub/seahub/utils/", 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:


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.

I had the same issue logging in from the Android app.
I fixed with the following patch:

cp -p /opt/seafile/seafile-server-8.0.3/seahub/seahub/api2/ /opt/seafile/seafile-server-8.0.3/seahub/seahub/api2/

vi /opt/seafile/seafile-server-8.0.3/seahub/seahub/api2/ # near line 130, fix mobile login
# jimays token.last_accessed is timezone-aware, so must be compared with such
# gratitude stackoverflow questions/4530069/how-do-i-get-a-value-of-datetime-today-in-py
# gratitude stackoverflow questions/5802108/how-to-check-if-a-datetime-object-is-localiz

        # if not within_time_range(token.last_accessed,, 10 * 60):

        import pytz
        if not within_time_range(token.last_accessed, if (token.last_accessed.tzinfo is None or token.last_accessed.tzinfo.utcoffset(token.last_accessed) is None) else datetime.datetime.utcnow().replace(tzinfo=pytz.utc), 10 * 60):