Cannot start seahub

I am having an issue with Seafile, I cannot start Seahub when running ./ restart command I get the following error:

root@seafile:/opt/seafile/seafile-server-8.0.2# ./ restart

Seahub is not running
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
Error:Seahub failed to start.
Please try to run "./ start" again

The specs of the box are as follows:

OS: Ubuntu 20.04 (all updates installed)
NGiNX: 1.18 (Ubuntu’s Repo)

Seafile does run:

root@seafile:/opt/seafile/seafile-server-latest# ./ start

Seafile controller is already running, pid 16807

But systemctl won’t run it:

root@seafile:/opt/seafile/seafile-server-8.0.2# systemctl start seafile.service
Job for seafile.service failed because the control process exited with error code.
See "systemctl status seafile.service" and "journalctl -xe" for details.
root@seafile:/opt/seafile/seafile-server-8.0.2# systemctl status seafile.service
● seafile.service - Seafile
     Loaded: loaded (/etc/systemd/system/seafile.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-01-11 20:14:19 UTC; 12s ago
    Process: 17073 ExecStart=/opt/seafile/seafile-server-latest/ start (code=exited, status=217/USER)

Jan 11 20:14:18 seafile systemd[1]: Starting Seafile...
Jan 11 20:14:18 seafile systemd[17073]: seafile.service: Failed to determine user credentials: No such process
Jan 11 20:14:18 seafile systemd[17073]: seafile.service: Failed at step USER spawning /opt/seafile/seafile-server-latest/ No such process
Jan 11 20:14:19 seafile systemd[1]: seafile.service: Control process exited, code=exited, status=217/USER
Jan 11 20:14:19 seafile systemd[1]: seafile.service: Failed with result 'exit-code'.
Jan 11 20:14:19 seafile systemd[1]: Failed to start Seafile.

Seahub doesn’t start:

root@seafile:/opt/seafile/seafile-server-latest# ./ start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
Error:Seahub failed to start.
Please try to run "./ start" again

What can I do to fix this? What am I doing wrong?

Try ./ start-fastcgi. It gives a more verbose output.
(Fastcgi-mode has been discontinued, but the command should still give you information.) There are many different possible reasons why seahub doesn’t start, mostly due to unmet python dependencies.

The issue was the lack of mysqlclient installed via pip3. So the instructions should be updated to install

apt-get install libmysqlclient-dev

and then

pip3 install mysqlclient

How did you determine that was the missing dependency? I’m in a similar boat as you with seahub unable to start, I installed all the pip modules from the instructions plus this mysql client but I’m still stuck, I’d love to be able to figure out the problem but I can’t get any log output or more detailed error message. start-fastcgi just gives me Unknown command: 'runfcgi'.

try pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy django-pylibmc django-simple-captcha python3-ldap future mysqlclient lxml captcha

If you still get start errors, make sure to run start with your seafile user instead of root to catch any permission problems.

I have never had pip3 on my Debian 10 system. I am running mariadb and getting

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
Error:Seahub failed to start.

even though I have run the following:
apt-get install default-libmysqlclient-dev python-pip3

pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

when I run sudo pip3 install future mysqlclient, I get:
error: invalid command ‘bdist_wheel’
Failed building wheel for mysqlclient

Reverting back to 7.1.5 until I have more info on how to potentially resolve this.

Thank you, I was missing the lxml python dependency. Now it’s working. The frustrating part is that this dependency is (apparently) not documented, and that the error messages when a python dependency is missing are completely opaque.

Edit: Seahub not actually working, my eyes fooled me.

Sorry, although I was in fact missing the lxml module, installing it didn’t correct my error. I didn’t see the Seahub failed to start message somehow at first, but when I went to pull up seahub in the browser it didn’t work and when I went back to the terminal I saw that dreaded error message. So I’m back at square one, I can’t start seahub and I have zero error output as to why it won’t work.

I had a similar problem. I needed to install ntfs-3g to get Seahub to start.

Thanks for the suggestion but installing ntfs-3g did not help. It would’ve been very odd if it did since I’m not using ntfs anywhere on the system.

My issue was resolved here: Error:Seahub failed to start - RPI 7.1.5

There was no missing dependency or anything like that, rather the config was pointing to a pids folder that didn’t exist.

Hello, i have the same problem, but I did not understand what to do to correct?

No error found on log : seafile.log :
[01/30/21 12:43:01] socket file exists, delete it anyway
[01/30/21 12:43:01] …/common/seaf-utils.c(328): Use database sqlite
[01/30/21 12:43:01] http-server.c(181): fileserver: worker_threads = 10
[01/30/21 12:43:01] http-server.c(196): fileserver: fixed_block_size = 8388608
[01/30/21 12:43:01] http-server.c(211): fileserver: web_token_expire_time = 3600
[01/30/21 12:43:01] http-server.c(226): fileserver: max_indexing_threads = 1
[01/30/21 12:43:01] http-server.c(241): fileserver: max_index_processing_threads= 3
[01/30/21 12:43:01] http-server.c(263): fileserver: cluster_shared_temp_file_mode = 600
[01/30/2021 12:43:05 PM] start to serve on pipe client

[01/30/21 12:43:00] seafile-controller.c(189): starting seaf-server …
[01/30/21 12:43:00] seafile-controller.c(80): spawn_process: seaf-server -F /home/haiwen/conf -c /home/haiwen/ccnet -d /home/haiwen/seafile-data -l /home/haiwen/logs/seafile.log -P /home/haiwen/pids/ -p /home/haiwen/seafile-server-8.0.2/runtime
[01/30/21 12:43:00] seafile-controller.c(114): spawned seaf-server, pid 356985

bart@FR-Online:~$ uname -a
Linux FR-Online 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Same start issue here. But it’s maybe I already use Debian 9?

Here version of default-libmysqlclient-dev:

root@canterlot /home/seafile # apt list default-libmysqlclient-dev
Listing... Done
default-libmysqlclient-dev/oldstable,oldstable,now 1.0.2 amd64 [installed]

And here of the pips:

root@canterlot /home/seafile # pip3 list
Package                   Version
------------------------- -------
altgraph                  0.17
asgiref                   3.2.10
captcha                   0.3
Cython                    0.29.21
Django                    3.1
django-pylibmc            0.6.1
django-ranged-response    0.2.0
django-simple-captcha     0.5.12
future                    0.18.2
Jinja2                    2.11.2
lxml                      4.6.2
MarkupSafe                1.1.1
mysqlclient               2.0.3
Pillow                    7.2.0
pip                       21.0.1
pyasn1                    0.4.8
pyinstaller               4.0
pyinstaller-hooks-contrib 2020.7
pylibmc                   1.6.1
pytz                      2020.1
setuptools                40.8.0
six                       1.15.0
SQLAlchemy                1.3.18
sqlparse                  0.3.1
wheel                     0.35.1

Btw. There is no something useful in the logs.

Sorry about that. Thinking back, I think my problem was starting the seadrive-client.

Somehow installing mysqlclient with pip wasn’t enough. The error log was constantly complaining about the wrong mysqlclient version.

return _bootstrap._gcd_import(name[level:], package, level)
      File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/db/backends/mysql/", line 36, in <module>
        raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
    django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 1.3.10.

The following worked for me, Debian 10.

I actually have had to upgrade mysqlclient as well.

apt remove -y default-libmysqlclient-dev
apt-get install -y libmariadbclient-dev
pip3 install mysqlclient
pip3 install -U mysqlclient

It would be very nice if the manual would somehow contain working instructions. mysql ist not used on most Debian/Ubuntu systems but mariadb instead. Hence many references need changing.

1 Like