ubuntu20.04下seahub无法启动

安装Seafile 9.0.x 版本时
到最后一步启动seahub时报错

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 “./seahub.sh start” again

没有明确的报错信息,重试也无法解决

有没有人遇到过同样的问题啊

seahub 启动不了可以改 gunicorn.conf 的daemon = True 为 False 看一下 启动报错

1 个赞

获得了报错信息如下:
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …
Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/bin/gunicorn”, line 8, in
sys.exit(run())
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/app/wsgiapp.py”, line 67, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/app/base.py”, line 231, in run
super().run()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/app/base.py”, line 72, in run
Arbiter(self).run()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/arbiter.py”, line 58, in init
self.setup(app)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/arbiter.py”, line 118, in setup
self.app.wsgi()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/app/base.py”, line 67, in wsgi
self.callable = self.load()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/app/wsgiapp.py”, line 58, in load
return self.load_wsgiapp()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/app/wsgiapp.py”, line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/gunicorn/util.py”, line 359, in import_app
mod = importlib.import_module(module)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/opt/seafile/seafile-server-9.0.6/seahub/seahub/wsgi.py”, line 25, in
application = get_wsgi_application()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/django/core/wsgi.py”, line 12, in get_wsgi_application
django.setup(set_prefix=False)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/django/apps/registry.py”, line 114, in populate
app_config.import_models()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/django/apps/config.py”, line 301, in import_models
self.models_module = import_module(models_module_name)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/registration/models.py”, line 13, in
from seahub.base.accounts import User
File “/opt/seafile/seafile-server-9.0.6/seahub/seahub/base/accounts.py”, line 28, in
from seahub.share.models import ExtraSharePermission
File “/opt/seafile/seafile-server-9.0.6/seahub/seahub/share/models.py”, line 19, in
from seahub.utils.hasher import AESPasswordHasher
File “/opt/seafile/seafile-server-9.0.6/seahub/seahub/utils/hasher.py”, line 4, in
from Crypto.Cipher import AES
File “/usr/local/lib/python3.8/dist-packages/Crypto/Cipher/init.py”, line 27, in
from Crypto.Cipher._mode_ecb import _create_ecb_cipher
File “/usr/local/lib/python3.8/dist-packages/Crypto/Cipher/_mode_ecb.py”, line 29, in
from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
File “/usr/local/lib/python3.8/dist-packages/Crypto/Util/_raw_api.py”, line 81, in
ffi = FFI()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/cffi/api.py”, line 54, in init raise Exception(“Version mismatch: this is the ‘cffi’ package version %s, located in %r. When we import the top-level ‘_cffi_backend’ extension module, we get version %s, located in %r. The two versions should be equal; check your installation.” % (
Exception: Version mismatch: this is the ‘cffi’ package version 1.14.0, located in ‘/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/cffi/api.py’. When we import the top-level ‘_cffi_backend’ extension module, we get version 1.15.0, located in ‘/usr/local/lib/python3.8/dist-packages/_cffi_backend.cpython-38-x86_64-linux-gnu.so’. The two versions should be equal; check your installation.
Error:Seahub failed to start.
Please try to run “./seahub.sh start” again

我删除了1.15.0版本,重新安装了1.14.0
sudo pip uninstall cffi
sudo pip install cffi==1.14.0

但是依旧没有启动起来,报错如下:
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …
[2022-08-16 13:49:25 +0000] [2286] [INFO] Starting gunicorn 20.1.0
[2022-08-16 13:49:25 +0000] [2286] [ERROR] Connection in use: (‘127.0.0.1’, 8000)
[2022-08-16 13:49:25 +0000] [2286] [ERROR] Retrying in 1 second.
[2022-08-16 13:49:26 +0000] [2286] [ERROR] Connection in use: (‘127.0.0.1’, 8000)
[2022-08-16 13:49:26 +0000] [2286] [ERROR] Retrying in 1 second.
[2022-08-16 13:49:27 +0000] [2286] [ERROR] Connection in use: (‘127.0.0.1’, 8000)
[2022-08-16 13:49:27 +0000] [2286] [ERROR] Retrying in 1 second.
[2022-08-16 13:49:28 +0000] [2286] [ERROR] Connection in use: (‘127.0.0.1’, 8000)
[2022-08-16 13:49:28 +0000] [2286] [ERROR] Retrying in 1 second.
[2022-08-16 13:49:29 +0000] [2286] [ERROR] Connection in use: (‘127.0.0.1’, 8000)
[2022-08-16 13:49:29 +0000] [2286] [ERROR] Retrying in 1 second.
[2022-08-16 13:49:30 +0000] [2286] [ERROR] Can’t connect to (‘127.0.0.1’, 8000)

看看8000 端口是不是被占了

1 个赞

确实是端口被别的程序占用了,修改端口后就可以运行。感谢帮助 :pray:

seafile@VM-16-16-ubuntu:/opt/seafile/seafile-server-9.0.7$ ./seahub.sh start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 …
/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.11) or chardet (5.0.0)/charset_normalizer (2.0.12) doesn’t match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "
Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/backends/mysql/base.py”, line 15, in
import MySQLdb as Database
ModuleNotFoundError: No module named ‘MySQLdb’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.7/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/core/management/init.py”, line 419, in execute_from_command_line
utility.execute()
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/core/management/init.py”, line 395, in execute
django.setup()
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/apps/registry.py”, line 114, in populate
app_config.import_models()
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/apps/config.py”, line 301, in import_models
self.models_module = import_module(models_module_name)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/contrib/sessions/models.py”, line 1, in
from django.contrib.sessions.base_session import (
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/contrib/sessions/base_session.py”, line 26, in
class AbstractBaseSession(models.Model):
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/models/base.py”, line 122, in new
new_class.add_to_class(’_meta’, Options(meta, app_label))
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/models/base.py”, line 326, in add_to_class
value.contribute_to_class(cls, name)
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/models/options.py”, line 207, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/utils/connection.py”, line 15, in getattr
return getattr(self._connections[self._alias], item)
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/utils/connection.py”, line 62, in getitem
conn = self.create_connection(alias)
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/utils.py”, line 204, in create_connection
backend = load_backend(db[‘ENGINE’])
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/utils.py”, line 111, in load_backend
return import_module(’%s.base’ % backend_name)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/opt/seafile/seafile-server-9.0.7/seahub/thirdpart/django/db/backends/mysql/base.py”, line 17, in
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
8000端口没有被占, mysqlclient 也安装了