启动没有任何错误提示:
[root@xxx ~]# /home/seafile/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
日志也貌似没有错误:
/home/seafile/logs/ccnet.log
/home/seafile/logs/seafile.log
/home/seafile/logs/controller.log
/home/seafile/logs/seahub.log
哪位帮忙看看,谢谢。
已解决
#寻找问题
通过研究seahub.sh,发现是start_seahub ()中pgrep -f "seahub.wsgi:application"检查状态不对导致出错提示,进而发现是运行$PYTHON $gunicorn_exe seahub.wsgi:application -c “${gunicorn_conf}” --preload有问题,对应的gunicorn未能启动。
${gunicorn_conf}对应的是/home/seafile/conf/gunicorn.conf.py,发现其中有个配置daemon = True,改为daemon = False,启动出现以下提示
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
是系统中sqlite3的版本低了导致django检查环境未通过。
#升级sqlite3
我用的是centos7,运行yum install sqlite upgrade发现已经是最新版,只能手动升级
wget https://www.sqlite.org/2020/sqlite-autoconf-3340000.tar.gz
tar zxvf sqlite-autoconf-3340000.tar.gz
cd sqlite-autoconf-3340000
./configure --prefix=/usr/local/sqlite
make
make install
mv /usr/bin/sqlite3 /usr/bin/sqlite3_old
ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3
vi /etc/ld.so.conf
/usr/local/sqlite/lib
ldconfig -v
#发现新问题
升级sqlite3后再次启动,可以正常运行,但是有个警告提示Warning: File comment has changed since version 6.3, while table base_filecomment
is not migrated yet, please consider migrate it according to v6.3.0 release note, otherwise the file comment feature will not work correctly.
查阅对应文档https://manual.seafile.com/changelog/server-changelog/的6.3版本升级要求,提示运行./seahub.sh python-env seahub/manage.py migrate_file_comment,但是出错AttributeError: ‘module’ object has no attribute ‘lru_cache’
查阅论坛中https://bbs.seafile.com/t/topic/11077/2,看了下我的base_filecomment这个表里面数据为空,所以直接按照提示删除seahub.db中的base_filecomment然后重建
CREATE TABLE “base_filecomment” (“id” integer NOT NULL PRIMARY KEY AUTOINCREMENT, “author” varchar(255) NOT NULL, “comment” text NOT NULL, “created_at” datetime NOT NULL, “updated_at” datetime NOT NULL, “uuid_id” char(32) NOT NULL REFERENCES “tags_fileuuidmap” (“uuid”), “detail” text NOT NULL, “resolved” bool NOT NULL);
解决,将配置daemon = False修改回去,恢复。