No access to seafile-server after upgrade from 6.2.5 to 6.3.4

Hi,

I till today (aprox. 17:17) i was running seafile 6.2.5 on my Raspberry Pi 3. I´ve already moved from fast-cgi to WSGI months ago. Even Though the update script seemed to work fine my seafile-service isn´t working :frowning:
The Desktop client tells me there is no connection and the Website answers with “Internal Server Error”. I´m running seafile-server with MySQL and Nginx.

Here are the newest snippets of my seafile/nignx logs

ccnet.log

[10/28/18 17:21:00] ../common/session.c(132): using config file /mnt/pidrive/seafile/conf/ccnet.conf
[10/28/18 17:21:00] ../common/session.c(455): socket file exists, delete it anyway
[10/28/18 17:21:00] ../common/session.c(484): Listen on /mnt/pidrive/seafile/ccnet/ccnet.sock for local clients
[10/28/18 17:21:00] ../common/session.c(290): Update pubinfo file
[10/28/18 17:21:00] ../common/session.c(398): Accepted a local client
[10/28/18 17:21:25] ../common/session.c(398): Accepted a local client
[10/28/18 17:21:25] ../common/peer.c(943): Local peer down
[10/28/18 17:21:50] ../common/session.c(369): Exit at Sun Oct 28 17:21:50 2018

[10/28/18 17:22:28] ../common/session.c(132): using config file /mnt/pidrive/seafile/conf/ccnet.conf
[10/28/18 17:22:29] ../common/session.c(455): socket file exists, delete it anyway
[10/28/18 17:22:29] ../common/session.c(484): Listen on /mnt/pidrive/seafile/ccnet/ccnet.sock for local clients
[10/28/18 17:22:29] ../common/session.c(290): Update pubinfo file
[10/28/18 17:22:29] ../common/session.c(398): Accepted a local client
[10/28/18 17:22:33] ../common/session.c(398): Accepted a local client
[10/28/18 17:22:33] ../common/peer.c(943): Local peer down

seafile.log

[10/28/18 16:53:47] size-sched.c(96): Repo size compute queue size is 0
[10/28/18 16:58:47] size-sched.c(96): Repo size compute queue size is 0
[10/28/18 17:03:47] size-sched.c(96): Repo size compute queue size is 0
[10/28/18 17:21:50] Disconnected from daemon
[10/28/18 17:22:30] http-server.c(173): fileserver: worker_threads = 10
[10/28/18 17:22:30] http-server.c(188): fileserver: fixed_block_size = 8388608
[10/28/18 17:22:30] http-server.c(203): fileserver: web_token_expire_time = 3600
[10/28/18 17:22:30] http-server.c(218): fileserver: max_indexing_threads = 1
[10/28/18 17:22:30] http-server.c(233): fileserver: max_index_processing_threads= 3
[10/28/18 17:22:30] ../common/mq-mgr.c(54): [mq client] mq cilent is started
[10/28/18 17:22:31] size-sched.c(96): Repo size compute queue size is 0

seahub_django_request.log

NetworkError: Can't connect to daemon

seahub.error.log (nginx)

2018/10/28 17:21:10 [error] 17785#0: *439219 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "myDomain.com"
2018/10/28 17:21:10 [error] 17785#0: *439219 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "myDomain.com", referrer: "https://myDomain.com/"
2018/10/28 17:21:13 [error] 17785#0: *439219 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "myDomain.com"
2018/10/28 17:21:13 [error] 17785#0: *439219 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "myDomain.com", referrer: "https://myDomain.com/"
2018/10/28 17:22:33 [error] 833#0: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET /api2/ping/ HTTP/1.1", upstream: "http://127.0.0.1:8000/api2/ping/", host: "myDomain.com"
2018/10/28 17:22:33 [error] 833#0: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET /api2/account/info/ HTTP/1.1", upstream: "http://127.0.0.1:8000/api2/account/info/", host: "myDomain.com"
2018/10/28 17:22:43 [error] 836#0: *22 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.112, server: myDomain.com, request: "GET /api2/events/ HTTP/1.1", upstream: "http://127.0.0.1:8000/api2/events/", host: "myDomain.com"

error.log (Nginx)

2018/10/28 17:17:37 [error] 17785#0: *438876 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.111, server: myDomain.com, request: "GET /seafhttp/repo/9b1dff28-435c-416a-bd84-5db15ca62e06/commit/HEAD HTTP/1.1", upstream: "http://127.0.0.1:8082/repo/9b1dff28-435c-416a-bd84-5db15ca62e06/commit/HEAD", host: "myDomain.com"
2018/10/28 17:20:55 [error] 17785#0: *438059 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.112, server: myDomain.com, request: "POST /seafhttp/repo/head-commits-multi/ HTTP/1.1", upstream: "http://127.0.0.1:8082/repo/head-commits-multi/", host: "myDomain.com"
2018/10/28 17:20:56 [error] 17785#0: *439212 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.112, server: myDomain.com, request: "POST /seafhttp/repo/head-commits-multi/ HTTP/1.1", upstream: "http://127.0.0.1:8082/repo/head-commits-multi/", host: "myDomain.com"
2018/10/28 17:21:10 [error] 17785#0: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2018/10/28 17:22:27 [error] 834#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.112, server: myDomain.com, request: "POST /seafhttp/repo/head-commits-multi/ HTTP/1.1", upstream: "http://127.0.0.1:8082/repo/head-commits-multi/", host: "myDomain.com"
2018/10/28 17:22:28 [error] 835#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 123.234.123.112, server: myDomain.com, request: "POST /seafhttp/repo/head-commits-multi/ HTTP/1.1", upstream: "http://127.0.0.1:8082/repo/head-commits-multi/", host: "myDomain.com"
2018/10/28 17:23:42 [error] 836#0: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
2018/10/28 17:28:51 [error] 833#0: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53

Service status

pi@pi31:/mnt/pidrive/seafile $ sudo service seafile status
● seafile.service - Seafile Server
   Loaded: loaded (/etc/systemd/system/seafile.service; enabled)
   Active: active (exited) since So 2018-10-28 17:22:31 CET; 27min ago
  Process: 1363 ExecStart=/mnt/pidrive/seafile/seafile-server-latest/seafile.sh start (code=exited, status=0/SUCCESS)
 Main PID: 1363 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/seafile.service
           ├─1432 /mnt/pidrive/seafile/seafile-server-6.3.4/seafile/bin/seafile-controller -c /mnt/pidrive/seafile/ccnet -d /mnt/pidrive/seafile/seafile-data -F /mnt/pidrive/seafile/conf...
           ├─1434 ccnet-server -F /mnt/pidrive/seafile/conf -c /mnt/pidrive/seafile/ccnet -f /mnt/pidrive/seafile/logs/ccnet.log -d -P /mnt/pidrive/seafile/pids/ccnet.pid
           └─1474 seaf-server -F /mnt/pidrive/seafile/conf -c /mnt/pidrive/seafile/ccnet -d /mnt/pidrive/seafile/seafile-data -l /mnt/pidrive/seafile/logs/seafile.log -P /mnt/pidrive/sea...

Okt 28 17:22:28 pi31 seafile.sh[1363]: [10/28/18 17:22:25] ../common/session.c(132): using config file /mnt/pidrive/seafile/conf/ccnet.conf
Okt 28 17:22:28 pi31 seafile.sh[1363]: Starting seafile server, please wait ...
Okt 28 17:22:31 pi31 seafile.sh[1363]: Seafile server started
Okt 28 17:22:31 pi31 seafile.sh[1363]: Done.
Okt 28 17:22:31 pi31 systemd[1]: Started Seafile Server.

pi@pi31:/mnt/pidrive/seafile $ sudo service seahub status
● seahub.service - Seahub Service
   Loaded: loaded (/etc/systemd/system/seahub.service; enabled)
   Active: active (exited) since So 2018-10-28 17:22:41 CET; 27min ago
  Process: 1554 ExecStart=/mnt/pidrive/seafile/seafile-server-latest/seahub.sh start (code=exited, status=0/SUCCESS)
 Main PID: 1554 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/seahub.service
           ├─1572 python2.7 /mnt/pidrive/seafile/seafile-server-6.3.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /mnt/pidrive/seafile/conf/gunicorn.conf --preload
           ├─1612 python2.7 /mnt/pidrive/seafile/seafile-server-6.3.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /mnt/pidrive/seafile/conf/gunicorn.conf --preload
           ├─1613 python2.7 /mnt/pidrive/seafile/seafile-server-6.3.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /mnt/pidrive/seafile/conf/gunicorn.conf --preload
           ├─1614 python2.7 /mnt/pidrive/seafile/seafile-server-6.3.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /mnt/pidrive/seafile/conf/gunicorn.conf --preload
           ├─1615 python2.7 /mnt/pidrive/seafile/seafile-server-6.3.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /mnt/pidrive/seafile/conf/gunicorn.conf --preload
           └─1616 python2.7 /mnt/pidrive/seafile/seafile-server-6.3.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /mnt/pidrive/seafile/conf/gunicorn.conf --preload

Okt 28 17:22:32 pi31 seahub.sh[1554]: LC_ALL is not set in ENV, set to en_US.UTF-8
Okt 28 17:22:32 pi31 seahub.sh[1554]: /mnt/pidrive/seafile/seafile-server-latest/seahub.sh: Zeile 208: Warnung: setlocale: LC_ALL: Kann die Locale nicht ändern (en_US.UTF-8)… nicht gefunden
Okt 28 17:22:32 pi31 seahub.sh[1554]: Starting seahub at port 8000 ...
Okt 28 17:22:41 pi31 seahub.sh[1554]: Seahub is started
Okt 28 17:22:41 pi31 seahub.sh[1554]: Done.
Okt 28 17:22:41 pi31 systemd[1]: Started Seahub Service.

Open ports

pi@pi31:/mnt/pidrive/seafile $ sudo netstat -lptu
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:4200                  *:*                     LISTEN      810/shellinaboxd
tcp        0      0 localhost:mysql         *:*                     LISTEN      1289/mysqld
tcp        0      0 localhost:11211         *:*                     LISTEN      663/memcached
tcp        0      0 *:http                  *:*                     LISTEN      832/nginx -g daemon
tcp        0      0 *:8082                  *:*                     LISTEN      1474/seaf-server
tcp        0      0 *:ssh                   *:*                     LISTEN      712/sshd
tcp        0      0 *:https                 *:*                     LISTEN      832/nginx -g daemon
tcp        0      0 *:8000                  *:*                     LISTEN      1572/python2.7
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      712/sshd
udp        0      0 *:mdns                  *:*                                 369/avahi-daemon: r
udp        0      0 *:41924                 *:*                                 369/avahi-daemon: r
udp        0      0 *:bootpc                *:*                                 662/dhcpcd
udp        0      0 pi31.fritz.box:ntp      *:*                                 797/ntpd
udp        0      0 localhost:ntp           *:*                                 797/ntpd
udp        0      0 *:ntp                   *:*                                 797/ntpd
udp6       0      0 [::]:42197              [::]:*                              369/avahi-daemon: r
udp6       0      0 [::]:mdns               [::]:*                              369/avahi-daemon: r
udp6       0      0 2003:c8:xxxx:xxxx:8:ntp [::]:*                              797/ntpd
udp6       0      0 fe80::xxx:xxx:ntp [::]:*                              797/ntpd
udp6       0      0 localhost:ntp           [::]:*                              797/ntpd
udp6       0      0 [::]:ntp                [::]:*                              797/ntpd

Any idea what´s wrong with my seafile-server?

I also tried the same update (6.2.5 to 6.3.4) today on my Raspberry and my server stopped working too. It took me the whole day to figure out was was going wrong because no log file contained any error messages.

What I found out:

  • Seafile seems to require a version of Python’s urllib3 that is newer than what is available from the official Raspbian repositories.
  • When installing requests (and thus urllib3) via pip instead of the official repositories it still fails since the current urllib3 version 1.24 seems to be incompatible
  • After forcing installation of urllib3 in version 1.23 seafile worked again

I am neither an expert in seafile administration nor python but to me it seems seafile comes with its own requests package (seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg) but it does not provide the urllib3 package. Therefore I guess it is necessary to have a compatible urllib3 package installed manually.

Is this assessment correct? Would it be possible to bundle all the necessary Python packages with seafile? Is it possible to enhance logging so that such errors are shown in log files?

1 Like

Thanks for your input :slight_smile:
Here is my step-by-step solution:

pip show urllib3

Name: urllib3
Version: 1.9.1 […]

sudo pip install --upgrade pip // upgrade from 9.0.1 to 18.1 (was recommended by pip)
sudo pip install -I urllib3==1.23

service seahub stop
service seafile stop
service seahub start
service seahub start

Everything works :hugs:

P.S: My Raspian version is (uname -a)

Linux pi31 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

1 Like

Not really, I’m using raspbian Jessy for compiling and I can observe urlib3 1.22 and request 2.18.4:

desigual@thor ~/env_seafile/dev/seahub_thirdpart $ sudo pip show urllib3
Name: urllib3
Version: 1.22
Summary: HTTP library with thread-safe connection pooling, file post, and more.
Home-page: https://urllib3.readthedocs.io/
Author: Andrey Petrov
Author-email: andrey.petrov@shazow.net
License: MIT
Location: /usr/local/lib/python2.7/dist-packages
Requires:
Required-by: requests
desigual@thor ~/env_seafile/dev/seahub_thirdpart $ sudo pip show requests
Name: requests
Version: 2.18.4
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: me@kennethreitz.org
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: certifi, chardet, idna, urllib3
Required-by: pipdate
desigual@thor ~/env_seafile/dev/seahub_thirdpart $

Like I said, urlib3 1.22 should be Ok too, not need of 1.24.

Yes, some of them, are included, other like Pillow not. I could ship urlib3 in seahub_thirdpart as well next time. Actually the thirdpart Python packages are 61M; a big part of Seafile Server.

When seahub doesn’t start, you can enhance logging changing the line daemon = True to False inside gunicorn.conf and restart seahub. You will see this dependence problem :slight_smile:

Hello,

I had also a HTTP 500 error after upgrading from seafile 2.2->3.4 from a Raspbian
In seahub.log :

2018-11-02 14:51:32,507 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /favicon.ico
Traceback (most recent call last):
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/handlers/base.py", line 244, in _legacy_get_response
    response = middleware_method(request)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/middleware/locale.py", line 24, in process_request
    i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/utils/lru_cache.py", line 100, in wrapper
    result = user_function(*args, **kwds)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/conf/urls/i18n.py", line 29, in is_language_prefix_patterns_used
    for url_pattern in get_resolver(urlconf).url_patterns:
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/urls/resolvers.py", line 407, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/urls/resolvers.py", line 400, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/seahub/utils/rooturl.py", line 41, in <module>
    url(r'^%s' % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)),
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/seahub/urls.py", line 12, in <module>
    from seahub.views.file import view_history_file, view_trash_file,\
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/seahub/views/file.py", line 41, in <module>
    from seahub.wopi.utils import get_wopi_dict
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/seahub/wopi/utils.py", line 7, in <module>
    import requests
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/__init__.py", line 97, in <module>
    from . import utils
  File "/home/pi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/utils.py", line 24, in <module>
    from . import certs
ImportError: cannot import name certs

I had urllib3 1.24 and requests 2.20.0
I did sudo pip install -I urllib3==1.23 and it was working after.

I had the same problem on another Raspbian Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

Thank you MokaMokiMoke