Fresh install, but start fails

I have a fresh installation on a raspberry pi 4b with MySQL – I followed the instructions here

the seafile server start just fint, but seahub does not: Error:Seahub failed to start. Please try to run “./ start” again

the log files are not helpful (see below).

I have tried changing the port (as I have another seafile server running on my LAN), but changing the port in and in ccnet.conf makes no difference (when starting it still lists 8000 as the port, despite the changes in conf files).

I have googled this quite a lot but I’m none the wiser.

I added DEBUG=true to the in …/conf – but still I’m not really getting any useful information to help me move on here.

I’ve rebooted several times, with no effect.

What to do to get more debug on the issue?

seafile server 8.0.7 for the RPI, running on Ubuntu server 20.04 on a RPI 4b with external USB SSD.

seahub.log is empty


2021-09-18 11:29:46 socket file exists, delete it anyway
2021-09-18 11:29:46 …/common/seaf-utils.c(333): Use database Mysql
2021-09-18 11:29:46 http-server.c(192): fileserver: worker_threads = 10
2021-09-18 11:29:46 http-server.c(206): fileserver: fixed_block_size = 8388608
2021-09-18 11:29:46 http-server.c(221): fileserver: web_token_expire_time = 3600
2021-09-18 11:29:46 http-server.c(236): fileserver: max_indexing_threads = 1
2021-09-18 11:29:46 http-server.c(251): fileserver: max_index_processing_threads= 3
2021-09-18 11:29:46 http-server.c(273): fileserver: cluster_shared_temp_file_mode = 600
2021-09-18 11:30:12 start to serve on pipe client

Files are unpacked correctly

$ tree /opt/seafile/ -L 2
├── ccnet
├── conf
│ ├── pycache
│ ├── ccnet.conf
│ ├──
│ ├── seafdav.conf
│ ├── seafile.conf
│ └──
├── logs
│ ├── controller.log
│ ├── onlyoffice.log
│ ├── seafile.log
│ └── seahub.log
├── pids
│ └──
├── seafile-data
│ ├── httptemp
│ ├── library-template
│ ├── storage
│ └── tmpfiles
├── seafile-server-8.0.7
│ ├──
│ ├──
│ ├── runtime
│ ├──
│ ├──
│ ├──
│ ├── seafile
│ ├──
│ ├── seahub
│ ├──
│ ├──
│ ├──
│ ├──
│ ├── sql
│ └── upgrade
├── seafile-server-8.0.7-focal-arm64v8.tar.gz
├── seafile-server-latest → seafile-server-8.0.7
└── seahub-data
└── avatars

I have the database up and running:

$ systemctl status mysql
● mariadb.service - MariaDB 10.3.31 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-09-18 10:16:26 UTC; 1h 12min ago
Docs: man:mysqld(8)
systemd - MariaDB Knowledge Base
Process: 2407 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (cod>
Process: 2408 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (co>
Process: 2410 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`c>
Process: 2488 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (c>
Process: 2490 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Main PID: 2457 (mysqld)
Status: “Taking your SQL requests now…”
Tasks: 32 (limit: 9025)
CGroup: /system.slice/mariadb.service
└─2457 /usr/sbin/mysqld


Same problem. I have external SSD connected via SSD to USB 3.0 Cable for Raspberry Pi from The Pi Hut web site.
Fresh seafile-server-8.0.7-buster-armv7l installation with sqlite database.
Seafile starts, seahub doesn’t.

As I can see it fails in the line:
gunicorn seahub.wsgi:application -c "${gunicorn_conf}" --preload

I was not able to make this line work.

When Seahub fails to start, it’s usually a communication problem with the database.

Two things come to mind:
1.) Make sure that you have installed all the prerequisites. You posted the right link - please note that Ubuntu 20.04 requires different (apt and pip) packages than Ubuntu 18.04.
2.) You can try and start seahub running ./ start-fastcgi. Seafile no longer supports fastcgi, but it may give you some more debug info.

rdb: I have ensured that I have the right packages installed for 20.04

using fastcgi, I get:

$ ./ start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at ...
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/MySQLdb/", line 18, in <module>
    from . import _mysql
ImportError: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/seafile/seafile-server-8.0.7/seahub/", line 10, in <module>
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/core/management/", line 381, in execute_from_command_line
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/core/management/", line 357, in execute
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/", line 24, in setup
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/apps/", line 114, in populate
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/apps/", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.8/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/contrib/sessions/", line 1, in <module>
    from django.contrib.sessions.base_session import (
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/contrib/sessions/", line 26, in <module>
    class AbstractBaseSession(models.Model):
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/models/", line 117, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/models/", line 321, in add_to_class
    value.contribute_to_class(cls, name)
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/models/", line 204, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/", line 28, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/", line 201, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/", line 110, in load_backend
    return import_module('%s.base' % backend_name)
  File "/usr/lib/python3.8/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/backends/mysql/", line 15, in <module>
    import MySQLdb as Database
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/MySQLdb/", line 24, in <module>
    version_info, _mysql.version_info, _mysql.__file__
NameError: name '_mysql' is not defined
Error:Seahub failed to start.

… a python/mysql module perhaps?

I found a fix:

sudo apt install libmariadbclient-dev

…that did it :grinning:

Glad this could be solved.

Could you mark as solved?

Thank you for fastcgi hint. In my case this line helped:
sudo apt install libopenjp2-tools

Which manual did you use? The dependencies should be clearly enumerated in the ARM setup instructions.

@sorenoneill Apologies, my question was meant for @stranger . But as you answered, let me add this: The manual you referenced is for x86. It’s possible that there are other dependencies for ARM.

@stranger We did you look for install instructions?

@rdb , sorry for the delay with response. I didn’t use any guide. Downloaded package for RPi, unpacked, run installation script.
Right now seahub starts successfully, but web interface is not available. Port is open in firewall. I’m using default (gunicorn) web server. Logs are empty.
Don’t know how to proceed debugging. According to the FAQ It is mostly likely some required Python packages of Seahub is not installed correctly., but I don’t know which one.
Could you please share installation instruction for RPi?

@jobenvil I am unfamiliar with Seafile for RasPi, so please excuse me if I am asking stupid questions.

stranger and sorenoneill followed the setup instructions in the Seafile Manual and failed installing Seafile on thei RasPis. But the Seafile Manual - which concerns itself only with the x86 version provided by Seafile Ltd. - should not be the problem: The instructions are correct. (I know it because I wrote them and tested them meticulously.)

The problems that sorenoneill and stranger encountered suggest that RasPi has other dependencies. Is this something you know and is this information captured anywhere for reference?

Thanks to you for your support to the RasPi community!!

@rdb sorry for false alarm. I forgot to change binding address from localhost and thats why didn’t see the web interface. Thanks everybody for help!

@rdb No issues - and sorry for late reply !

Actually there is no explicitely guide for installing Seafile Server on ARM devices. It should be the same guide as x64.

  1. The dependencies are the same, for example:

It is explained here and is basically because some people use pure mysql libraries and the others mariadb libraries.

  1. The Pillow dependencies like for example libopenjp2-tools, libtiff*

are commented always like a depencies for PIL / PIllow. The necessary libraries are mentioned itself in Pillow. We have this issue several times in new Seafile installations. Here is commented the issue.

I totally agree to mention those on the documentation.
.EDIT: It seems that another python mysql package is not reflected according to @sorenoneill .

Worked somewhat for me. Here is what I did (Ubuntu 22.04)

vi conf/


# daemon = True
daemon = False

then try

…/*latest/ start

and observe which Python packages are missing.

I did this:

pip3 install sqlalchemy
pip3 install --ignore-installed django-simple-captcha
pip3 install djangosaml2
apt-get install python3-dev default-libmysqlclient-dev build-essential
pip3 install mysqlclient
pip3 uninstall Pillow
pip3 install Pillow==9.5.0

Ahh I wonder if this will help me too. I posted about a clean v10 install on Centos b8 where Seahub failed to start in a very similar manner. I’ll be a tidge miffed if it’s a documentation problem. We really do need to all work together with some up to date install instructions for a variety of platform. It’ll be painful to get it first set-up but easier to maintain. Wandering but can’t we do something on Github?

Ohh hang on - somebody has replied to this thread from 2021…