一个centos7无法启动seahub的问题


#1

按照教程一步一步完成的安装
没有使用docker
seafile启动没问题
seahub启动失败,日志如下,但是信息太少了,也没有log,请教该如何解决问题呢?

[admin_user@QcloudServ01 seafile-server-latest]$ pwd
/home/admin_user/seafile/seafile-server-latest
[admin_user@QcloudServ01 seafile-server-latest]$ ll
total 148
-rw-r–r-- 1 admin_user admin_user 10899 Jan 26 12:02 check_init_admin.py
-rwxr-xr-x 1 admin_user admin_user 1805 Jan 26 12:02 reset-admin.sh
drwxr-xr-x 2 admin_user admin_user 4096 Feb 10 14:30 runtime
-rwxr-xr-x 1 admin_user admin_user 1746 Jan 26 12:02 seaf-fsck.sh
-rwxr-xr-x 1 admin_user admin_user 3134 Jan 26 12:02 seaf-fuse.sh
-rwxr-xr-x 1 admin_user admin_user 2641 Jan 26 12:02 seaf-gc.sh
drwxr-xr-x 7 admin_user admin_user 4096 Jan 26 12:03 seafile
-rwxr-xr-x 1 admin_user admin_user 4581 Jan 26 12:02 seafile.sh
drwxr-xr-x 15 admin_user admin_user 4096 Dec 30 12:13 seahub
-rwxr-xr-x 1 admin_user admin_user 7906 Jan 26 12:02 seahub.sh
-rw-r–r-- 1 admin_user admin_user 56437 Jan 26 12:02 setup-seafile-mysql.py
-rwxr-xr-x 1 admin_user admin_user 1548 Jan 26 12:02 setup-seafile-mysql.sh
-rwxr-xr-x 1 admin_user admin_user 22087 Jan 26 12:02 setup-seafile.sh
drwxr-xr-x 4 admin_user admin_user 4096 Dec 30 12:04 sql
drwxr-xr-x 4 admin_user admin_user 4096 Dec 30 12:06 upgrade
[admin_user@QcloudServ01 seafile-server-latest]$
[admin_user@QcloudServ01 seafile-server-latest]$ ./seahub.sh 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 “./seahub.sh start” again
[admin_user@QcloudServ01 seafile-server-latest]$
[admin_user@QcloudServ01 seafile-server-latest]$
[admin_user@QcloudServ01 seafile-server-latest]$ ll …/logs/
controller.log seafile.log seahub.log
[admin_user@QcloudServ01 seafile-server-latest]$ ll …/logs/seahub.log
-rw-r–r-- 1 admin_user admin_user 0 Feb 10 14:19 …/logs/seahub.log
[admin_user@QcloudServ01 seafile-server-latest]$


#2

把配置文件里的gunicorn.conf.py中的
daemon = True改成 daemon = False
启动seahub,就能看到报错信息


#3

翻找了一下论坛的类似问题,虽然问题没解决,但是问题点是找到了

  1. 用./seahub.sh start-fastcgi 命令,可以看到中间信息
  2. 我的问题在于
    ===========================================================
    [admin_user@QcloudServ01 seafile-server-latest]$ ./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 …
Traceback (most recent call last):
File “/home/admin_user/seafile/seafile-server-8.0.3/seahub/thirdpart/django/db/backends/mysql/base.py”, line 15, in
import MySQLdb as Database
ModuleNotFoundError: No module named ‘MySQLdb’

中间省略…

Error:Seahub failed to start.

===========================================================

继续排查,搜索,发现直接在python解释器里面运行
import MySQLdb
也有同样报错,可我已经安装了相关插件了,尝试重装
yum reinstall MySQL-python
然后,在python里正常了

[admin_user@QcloudServ01 seafile-server-latest]$ python
Python 2.7.5 (default, Nov 16 2020, 22:23:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import MySQLdb

=========================================================

但是问题仍然没有解决,我运行启动脚本,仍然报相同的错误::sob:


#4

新版本用的python3,试一试在pip3里面装下MySQLdb模块