Seahub启动失败,Error happened during creating seafile admin.

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …

Error happened during creating seafile admin.

Error:Seahub failed to start.
Please try to run “./seahub.sh start” again

Ubuntu 20.04.2 LTS
用的服务端是 8.0.3 64bit
sqlite方式部署

配置gunicorn.conf.py
daemon = True 改成 False,启动seahub。sh 看一下报错

没找到这个文件

我也刚装好,运行seahub.sh start,到填写管理员邮箱密码后,创建出错。

Error happened during creating seafile admin.

Traceback (most recent call last):
File “/home/whzsea/seafile-server/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 “/home/whzsea/seafile-server/seahub/thirdpart/bin/gunicorn”, line 8, in
sys.exit(run())
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/app/wsgiapp.py”, line 58, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/app/base.py”, line 228, in run
super().run()
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/app/base.py”, line 72, in run
Arbiter(self).run()
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/arbiter.py”, line 58, in init
self.setup(app)
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/arbiter.py”, line 118, in setup
self.app.wsgi()
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/app/base.py”, line 67, in wsgi
self.callable = self.load()
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/app/wsgiapp.py”, line 49, in load
return self.load_wsgiapp()
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/app/wsgiapp.py”, line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File “/home/whzsea/seafile-server/seahub/thirdpart/gunicorn/util.py”, line 358, 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 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/whzsea/seafile-server/seahub/seahub/wsgi.py”, line 25, in
application = get_wsgi_application()
File “/home/whzsea/seafile-server/seahub/thirdpart/django/core/wsgi.py”, line 12, in get_wsgi_application
django.setup(set_prefix=False)
File “/home/whzsea/seafile-server/seahub/thirdpart/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/home/whzsea/seafile-server/seahub/thirdpart/django/apps/registry.py”, line 114, in populate
app_config.import_models()
File “/home/whzsea/seafile-server/seahub/thirdpart/django/apps/config.py”, line 211, 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 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/whzsea/seafile-server/seahub/thirdpart/django/contrib/sessions/models.py”, line 1, in
from django.contrib.sessions.base_session import (
File “/home/whzsea/seafile-server/seahub/thirdpart/django/contrib/sessions/base_session.py”, line 26, in
class AbstractBaseSession(models.Model):
File “/home/whzsea/seafile-server/seahub/thirdpart/django/db/models/base.py”, line 117, in new
new_class.add_to_class(’_meta’, Options(meta, app_label))
File “/home/whzsea/seafile-server/seahub/thirdpart/django/db/models/base.py”, line 321, in add_to_class
value.contribute_to_class(cls, name)
File “/home/whzsea/seafile-server/seahub/thirdpart/django/db/models/options.py”, line 204, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File “/home/whzsea/seafile-server/seahub/thirdpart/django/db/init.py”, line 28, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File “/home/whzsea/seafile-server/seahub/thirdpart/django/db/utils.py”, line 201, in getitem
backend = load_backend(db[‘ENGINE’])
File “/home/whzsea/seafile-server/seahub/thirdpart/django/db/utils.py”, line 110, 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 “/home/whzsea/seafile-server/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?
Error:Seahub failed to start.
Please try to run “./seahub.sh start” again

我连管理员都创建不了,MySQL、sqlite都试过了,真的迷。MySQL到现在我都没整明白

我解决了,你解决了吗,找到/home/whzsea/seafile-server/seahub/thirdpart/django/db/backends/mysql/目录下的__init__.py文件,添加 一下代码
import pymysql

pymysql.install_as_MySQLdb()
然后再启动就可以了

重装了一遍用mysql
结果…

Successfully created seafile admin

Error:Seahub failed to start.
Please try to run “./seahub.sh start” again

日志哪看啊?

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 …
Traceback (most recent call last):
File “/home/wgx/server/seafile-server/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/home/wgx/server/seafile-server/seahub/thirdpart/django/core/management/ init .py”, line 381, in execute_from_command_line
utility.execute()
File “/home/wgx/server/seafile-server/seahub/thirdpart/django/core/management/ init .py”, line 357, in execute
django.setup()
File “/home/wgx/server/seafile-server/seahub/thirdpart/django/ init .py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/home/wgx/server/seafile-server/seahub/thirdpart/django/apps/registry.py”, line 91, in populate
app_config = AppConfig.create(entry)
File “/home/wgx/server/seafile-server/seahub/thirdpart/django/apps/config.py”, line 90, in create
module = import_module(entry)
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 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘captcha’
Error:Seahub failed to start.

用下面这个代码启动seahub,就能够看到报错的信息
./seahub.sh start-fastcgi

这样就能看到whz那样的代码,就能看到在哪里报错了

你这个只能根据他报的错误百度了,我当时也是根据错误信息百度的,你的错误跟我不一样

你可以参考这篇文章看看
https://blog.csdn.net/qq_45701131/article/details/109708721

/home/whzsea/seafile-server/seahub/thirdpart/django/db/backends/mysql/目录下的__init__.py文件,添加 一下代码
import pymysql

pymysql.install_as_MySQLdb()
运行出现这样:

What is the password for the admin account?
[ admin password ]

Enter the password again:
[ admin password again ]

Error happened during creating seafile admin.

[2021-03-14 13:55:14 +0000] [80898] [INFO] Starting gunicorn 20.0.4
[2021-03-14 13:55:14 +0000] [80898] [INFO] Listening at: http://127.0.0.1:8000 (80898)
[2021-03-14 13:55:14 +0000] [80898] [INFO] Using worker: sync
[2021-03-14 13:55:14 +0000] [80901] [INFO] Booting worker with pid: 80901
[2021-03-14 13:55:15 +0000] [80902] [INFO] Booting worker with pid: 80902
[2021-03-14 13:55:15 +0000] [80903] [INFO] Booting worker with pid: 80903
[2021-03-14 13:55:15 +0000] [80904] [INFO] Booting worker with pid: 80904
[2021-03-14 13:55:15 +0000] [80905] [INFO] Booting worker with pid: 80905

你这个只是缺少Python 模块而已

1 个赞

到这一步了,还缺少什么模块呢?

我回复的不是您的问题,但是您这个问题应该先看一下数据库的权限

我的mysql是8的,能不能指导一下,如何排查。刚新装的呀,安网站上手册操作的。

我的问题是ubuntu 20.10 + mysql 8 + seafile 8安装到最后出现Error happened during creating seafile admin.的问题。如果碰到同样问题可以这样做:配置/seafile/conf/gunicorn.conf.py,daemon = True 改成 False。再启动seahub.sh,看报错。同时看logs文件夹下的seafile.log文件报错。
如果出现:Failed to connect to MySQL: Plugin caching_sha2_password could not be loaded。主要是mysql8鉴权方式变了,但seafile没跟上,需要将鉴权改成旧的方式。
mysql –u root –p
Show databases;
Use database mysql
select user,host,plugin from mysql.user;
查看自己设置的seafile账户插件的鉴权。
然后用
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘自己密码’;
修改root鉴权。
ALTER USER ‘seafile帐号’@‘127.0.0.1’ IDENTIFIED WITH mysql_native_password BY ‘自己密码’;
我的不成功是因为没查看,一直用localhost去更新,造成失败。

seafile 目前不支持mysql 8.0