Seafile server not syncing with https

Hello,

My seafile client can’t sync anymore. I have made different upgrades and switched to https recently, and I’m not sure what caused the problem. I have seen a couple of other similar problems in the forum but none of the proposed solutions worked for me.

My setup :

Server
Seafile Community Edition version 6.0.3, running on a raspberrry pi
nginx as a front-end
using https with a certificate by letsencrypt

Client
Seafile desktop client for linux, version 5.1.4, running on ubuntu 16.04.1

The problem
The client doesn’t sync. The status message get stuck to “Connecting to server” and nothing downloads.

Some logs

Client side seafile.log :

[09/13/16 21:20:16] clone-mgr.c(819): Transition clone state for 37d4c4ab from [connect] to [connect].
[09/13/16 21:20:16] clone-mgr.c(819): Transition clone state for 44596f12 from [connect] to [connect].
[09/13/16 21:20:16] http-tx-mgr.c(707): libcurl failed to GET https://myserver.example.org/seafhttp/protocol-version: Failure when receiving data from the peer.
[09/13/16 21:20:16] http-tx-mgr.c(707): libcurl failed to GET https://myserver.example.org/seafhttp/protocol-version: SSL connect error.
[09/13/16 21:20:16] clone-mgr.c(819): Transition clone state for 37d4c4ab from [connect] to [connect].
[09/13/16 21:20:16] clone-mgr.c(819): Transition clone state for 44596f12 from [connect] to [connect].
[09/13/16 21:20:21] clone-mgr.c(819): Transition clone state for 37d4c4ab from [connect] to [connect].
[09/13/16 21:20:21] clone-mgr.c(819): Transition clone state for 44596f12 from [connect] to [connect].
[09/13/16 21:20:21] http-tx-mgr.c(707): libcurl failed to GET https://myserver.example.org/seafhttp/protocol-version: Server returned nothing (no headers, no data).
[09/13/16 21:20:21] clone-mgr.c(819): Transition clone state for 44596f12 from [connect] to [connect].

(I tried to grep nginx access and error logs to find traces of these /seafhttp/protocol-version requests but found nothing)

Server side seafile.log :

[09/13/16 00:35:12] …/common/session.c(398): Accepted a local client
[09/13/16 00:35:12] …/common/session.c(398): Accepted a local client
[09/13/16 00:35:12] …/common/session.c(398): Accepted a local client
[09/13/16 00:35:13] …/common/peer.c(943): Local peer down
[09/13/16 00:35:13] …/common/peer.c(943): Local peer down

My nginx configuration file

server {
    listen 80;
    server_name myserver.example.org;
    rewrite ^ https://$http_host$request_uri? permanent;
}

server {
    listen 443;
    ssl on;
    ssl_certificate /etc/letsencrypt/live/myserver.example.org/fullchain.pem;        # path to your cacert.pem                                    
    ssl_certificate_key /etc/letsencrypt/live/myserver.example.org/privkey.pem;    # path to your privkey.pem                                     
    server_name myserver.example.org;

    proxy_set_header X-Forwarded-For $remote_addr;

    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
    server_tokens off;

    location / {
        fastcgi_pass    127.0.0.1:8000;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param   PATH_INFO           $fastcgi_script_name;

        fastcgi_param    SERVER_PROTOCOL        $server_protocol;
        fastcgi_param   QUERY_STRING        $query_string;
        fastcgi_param   REQUEST_METHOD      $request_method;
        fastcgi_param   CONTENT_TYPE        $content_type;
        fastcgi_param   CONTENT_LENGTH      $content_length;
        fastcgi_param    SERVER_ADDR         $server_addr;
        fastcgi_param    SERVER_PORT         $server_port;
        fastcgi_param    SERVER_NAME         $server_name;
        fastcgi_param   REMOTE_ADDR         $remote_addr;
        fastcgi_param   HTTPS               on;
        fastcgi_param   HTTP_SCHEME         https;
        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
    }
    location /media {
        root /home/seafile/seafile-server-latest/seahub;
    }
}

What I tried

  • Upgrading client and server (I first had this problem when I was on a 4.x.x version, can’t remember the exact version)
  • Checking the “Ignore server certificate” in the client config (didn’t change a thing, but my certificate is valid, at least chrome and firefox sees it as valid)
  • Checking file ownership (there is a forum post with a user that solved his sync problem this way, I didn’t believe it would make any difference, because his logs did’nt show the same error as mine)
  • Frantically searching the interweb for another solution

What still works despite my problem

  • The web interface (with browser telling me that my certificate is valid), including downloads, uploads and batched uploads.
  • The android client, including the automatic photo/video backup.

Thank you for your attention.

Where should I look / what should I do to solve this problem ?

Thank you.

Interesting as your Android client is still working and usually it’s the other way round.
Have you configured fail2ban?
You may check the thread below as well.
https://forum.seafile.de/t/problems-with-seafile-client-4-2-4/1784/35

1 Like

Thank you so much, this was spot on.

I think i found the problem! I have to put

ssl_session_cache shared:SSL:10m;
ssl_session_timeout 30m;

in my nginx.conf and put every ssl_session command out of my seafile/mail nginx configurations

I did exactly that and now my client is happilly syncing !

(I don’t have fail2ban configured)

Thanks again