Seahub won't start anymore

Hi,

I am using Seafile 7.0.4 on Raspbian.

After some time using Seafile, the Seafile hub won’t start anymore (no updates on the os side has been installed).

Using systemd to start the seahub daemon leads to following error message:

● seahub.service - Seafile hub
   Loaded: loaded (/etc/systemd/system/seahub.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-08-21 16:15:33 CEST; 4s ago
  Process: 1454 ExecStart=/home/seafile/seafile-server-latest/seahub.sh start (code=exited, status=1/FAILURE)

Aug 21 16:15:24 seafile-pi systemd[1]: Starting Seafile hub...
Aug 21 16:15:24 seafile-pi seahub.sh[1454]: LC_ALL is not set in ENV, set to en_US.UTF-8
Aug 21 16:15:24 seafile-pi seahub.sh[1454]: Starting seahub at port 8000 ...
Aug 21 16:15:33 seafile-pi seahub.sh[1454]: Error:Seahub failed to start.
Aug 21 16:15:33 seafile-pi seahub.sh[1454]: Please try to run "./seahub.sh start" again
Aug 21 16:15:33 seafile-pi systemd[1]: seahub.service: Control process exited, code=exited status=1
Aug 21 16:15:33 seafile-pi systemd[1]: Failed to start Seafile hub.
Aug 21 16:15:33 seafile-pi systemd[1]: seahub.service: Unit entered failed state.
Aug 21 16:15:33 seafile-pi systemd[1]: seahub.service: Failed with result 'exit-code'.

There are no warning or errors in the logs file.

root@seafile-pi:/home/seafile# ls -altr logs/
insgesamt 9012
-rw-r--r--  1 seafile seafile    2070 Jul  7  2018 seahub_django_request.log
drwxr-xr-x  2 seafile seafile    4096 Sep  5  2018 .
-rw-r--r--  1 seafile seafile  141387 Aug  8 20:56 seahub.log
-rw-r--r--  1 seafile seafile  357957 Aug 21 14:43 gunicorn_access.log
-rw-r--r--  1 seafile seafile  127368 Aug 21 14:46 gunicorn_error.log
drwxr-xr-x 12 seafile seafile    4096 Aug 21 16:05 ..
-rw-r--r--  1 seafile seafile   36270 Aug 21 16:22 controller.log
-rw-r--r--  1 seafile seafile 8464707 Aug 21 16:22 seafile.log
-rw-r--r--  1 seafile seafile   50332 Aug 21 16:29 ccnet.log

My seahub config

# -*- coding: utf-8 -*-
SECRET_KEY = "[SECRET]"
FILE_SERVER_ROOT = 'https://[IP]/seafhttp'
ENABLE_SETTINGS_VIA_WEB = False

# TimeZone
TIME_ZONE = 'Europe/Berlin'


# Email Configuration
EMAIL_USE_TLS = True
EMAIL_HOST = '[SERVER]'
EMAIL_HOST_USER = '[USER]'
EMAIL_HOST_PASSWORD = '[PASSWORT]'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'seafile',
        'PASSWORD': '[PASSWORD]',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}

How can I fix this problem?

Kind regards

on gunicorn.conf
try to change
daemon = True to False
and start seahub again.You will see why seahub is failing to start. After that, revert config again.

Thank you for the tip.

I got following error message:

Aug 21 20:05:27 seafile-pi systemd[1]: Starting Seafile hub...
Aug 21 20:05:27 seafile-pi seahub.sh[1204]: LC_ALL is not set in ENV, set to en_US.UTF-8
Aug 21 20:05:28 seafile-pi seahub.sh[1204]: Starting seahub at port 8000 ...
Aug 21 20:05:31 seafile-pi seahub.sh[1204]: /home/seafile/seafile-server-latest/seahub.sh: line 156:  1217 Segmentation fault      $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload
Aug 21 20:05:36 seafile-pi systemd[1]: seahub.service: Control process exited, code=exited status=1

Important seems the error message

Aug 21 20:05:31 seafile-pi seahub.sh[1204]: /home/seafile/seafile-server-latest/seahub.sh: line 156: 1217 Segmentation fault $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload

I echoed this command and got following line

python2.7 /home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/seafile/conf/gunicorn.conf --preload

I execute the command by hand and got this error message:

Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn", line 11, in <module>
    load_entry_point('gunicorn==19.8.1', 'console_scripts', 'gunicorn')()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 61, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 223, in run
    super(Application, self).run()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/util.py", line 350, in import_app
    __import__(module)
ImportError: No module named seahub.wsgi

Seems that the module seahub.wsgi could not be imported.

Hi, do you use ARMv6 oder Jessie Distro? There are two versions for raspi.

Hi jobenvil

I installed the “seafile-server_7.0.4_stable_pi.tar.gz” file from github.

More information about my system:

root@seafile-pi:/home/seafile# cat /proc/device-tree/model
Raspberry Pi 2 Model B Rev 1.1

root@seafile-pi:~# cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs

root@seafile-pi:~# uname -a
Linux seafile-pi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

Hi jobenvil,

have you an idea how to fix this error.

I already installed python-certifi and python-idna before the upgrade.

After the change to daemon = False try to start the seahub with ./seahub start instead of service seahub start and check for the printed error.

I get the following error

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
./seahub.sh: line 246: 12931 Segmentation fault      $PYTHON $check_init_admin_script

I then echoed the line 246
python2.7 /home/seafile/seafile-server-7.0.4/check_init_admin.py

running this comman manually, I got following error:
Speicherzugriffsfehler
in english
segmentation fault

strange. Try python2.7 with other py file. How about for the rights of the /seafile directory?

The Permissions seem to be correct.

root@seafile-pi:~# ls -l /seafile/seafile-data/
insgesamt 24
drwxr-xr-x 2 seafile seafile 4096 Jul  7  2018 commits
drwxr-xr-x 2 seafile seafile 4096 Jul  7  2018 fs
drwxr-xr-x 3 seafile seafile 4096 Aug 21 16:09 httptemp
drwxr-xr-x 2 seafile seafile 4096 Jul  7  2018 library-template
drwxr-xr-x 5 seafile seafile 4096 Jul  7  2018 storage
drwxr-xr-x 2 seafile seafile 4096 Aug 26 21:43 tmpfiles

But something ist wrong with my python2.7

root@seafile-pi:~# python2.7
Speicherzugriffsfehler

python3.5 is working

root@seafile-pi:~# python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.

Could it be a hardware problem?

I was aware of that, since the two times when you used the commad python2.7 you got a Speicherzugriffsfehler, but since I didn’t see such error with python, I want to confirm it.

I would suggest reinstalling python 2.7. Somehow got damaged.

It seems that my sd card was damaged. With dd I moved the image to a new sd card and reinstalled python2.7.

python2.7 is now working.

But when I start seahub I get the same error again:

root@seafile-pi:/home/seafile/seafile-server-7.0.4# python2.7 /home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/seafile/conf/gunicorn.conf --preload
Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn", line 11, in <module>
    load_entry_point('gunicorn==19.8.1', 'console_scripts', 'gunicorn')()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 61, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 223, in run
    super(Application, self).run()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/util.py", line 350, in import_app
    __import__(module)
ImportError: No module named seahub.wsgi

Starting with systemctl

Aug 28 20:20:13 seafile-pi systemd[1]: Starting Seafile hub...
Aug 28 20:20:13 seafile-pi seahub.sh[1157]: LC_ALL is not set in ENV, set to en_US.UTF-8
Aug 28 20:20:13 seafile-pi seahub.sh[1157]: Starting seahub at port 8000 ...
Aug 28 20:20:14 seafile-pi seahub.sh[1157]: python2.7 /home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/seafile/conf/gunicorn.conf --preload
Aug 28 20:20:17 seafile-pi seahub.sh[1157]: /home/seafile/seafile-server-latest/seahub.sh: line 156:  1170 Segmentation fault      $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload
Aug 28 20:20:22 seafile-pi systemd[1]: seahub.service: Control process exited, code=exited status=1
Aug 28 20:20:22 seafile-pi systemd[1]: Failed to start Seafile hub.
Aug 28 20:20:22 seafile-pi systemd[1]: seahub.service: Unit entered failed state.
Aug 28 20:20:22 seafile-pi systemd[1]: seahub.service: Failed with result 'exit-code'.

You should change the daemon = False again and start seahub manually with ./seahub.sh start

Hi jobenvil,

first thank you for your help and your patient.

This what I get when running seahub.sh start with daemon = False

root@seafile-pi:/home/seafile/seafile-server-7.0.4# ./seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
python2.7 /home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/seafile/conf/gunicorn.conf --preload
./seahub.sh: line 156:   902 Segmentation fault      $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload
Error:Seahub failed to start.
Please try to run "./seahub.sh start" again

root@seafile-pi:/home/seafile/seafile-server-7.0.4# python2.7 /home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/seafile/conf/gunicorn.conf --preload
    Traceback (most recent call last):
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn", line 11, in <module>
        load_entry_point('gunicorn==19.8.1', 'console_scripts', 'gunicorn')()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 61, in run
        WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 223, in run
        super(Application, self).run()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 72, in run
        Arbiter(self).run()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 60, in __init__
        self.setup(app)
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 120, in setup
        self.app.wsgi()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 67, in wsgi
        self.callable = self.load()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 52, in load
        return self.load_wsgiapp()
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
        return util.import_app(self.app_uri)
      File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/util.py", line 350, in import_app
        __import__(module)
    ImportError: No module named seahub.wsgi

But python2.7 is working now. It seems I have to reinstall my system.

Again segmentation fault. Try to reinstall seafile, i mean, only to extract the new package tar -xvf…
And apply again minor upgrade.

I reinstalled seafile and used upgrade_6.3_7.0.sh

Starting seahub with seahub.sh start as the seafile user with daemon = False works now, but with systemctl I get a segmentation fault again.