Seafile Pro v9.0.6 升级到 v9.0.7之后,启动 seafile 服务正常,启动 seahub 服务报错
报错信息:
8月 15 17:57:50 s systemd[1]: Starting Seafile hub...
8月 15 17:57:50 s seahub.sh[434689]: LC_ALL is not set in ENV, set to en_US.UTF-8
8月 15 17:57:51 s seahub.sh[434689]: Starting seahub at port 8000 ...
8月 15 17:57:51 s seahub.sh[434699]: Error happened during creating seafile admin.
8月 15 17:57:56 s seahub.sh[434689]: Seahub is started
8月 15 17:57:56 s seahub.sh[434689]: Done.
8月 15 17:57:56 s systemd[1]: Started Seafile hub.
检查 seahub.log 日志 和 seafile.log 日志
seahub.log 报错看到一个消息有提示
PermissionError: [Errno 13] Permission denied: '/tmp/seahub_cache/ceec40422771f78d283f254429d1d993.djcache'
升级后没清空老旧的静态页面缓存,缓存导致的权限问题?执行命令清空静态页面缓存
rm -rf /tmp/seahub_cache/*
继续重启 seafile,访问页面继续报错,seahub 服务也报相同错误,继续检查 seafile.log
看到这个关键提示
2022-08-15 18:06:50 ../common/license.c(709): License file /home/seafile/seafile/seafile-license.txt does not exist, allow at most 3 trial users
2022-08-15 18:06:50 failed to bind unix socket fd to /home/seafile/seafile/seafile-pro-server-9.0.7/runtime/seafile.sock : 权限不够
2022-08-15 18:06:50 seaf-server.c(1569): Failed to start rpc server.
2022-08-15 18:07:00 ../common/seaf-utils.c(409): Use database Mysql
升级时使用了 root 身份执行升级脚本,脚本在重新指向最新版本的符号链接时,因为是 root 身份执行的部署和升级,检查 seafile 目录,发现异常
root@s:/home/seafile# ll ./seafile
总用量 60
drwxr-xr-x 13 seafile seafile 4096 2022-08-15 14:59:25 ./
drwxr-xr-x 9 seafile seafile 4096 2022-08-05 19:44:21 ../
drwx------ 2 seafile seafile 4096 2022-08-05 22:35:26 ccnet/
drwx------ 3 seafile seafile 4096 2022-08-05 22:36:44 conf/
drwx------ 3 seafile seafile 4096 2022-06-24 18:23:01 conf_bak/
drwxr-xr-x 2 seafile seafile 4096 2022-08-15 14:51:08 installed/
drwxr-xr-x 3 seafile seafile 4096 2022-08-09 00:03:38 logs/
drwxr-xr-x 2 seafile seafile 4096 2022-08-15 18:07:58 pids/
drwx------ 2 seafile seafile 4096 2022-08-05 22:35:26 pro-data/
drwx------ 7 seafile seafile 4096 2022-08-05 23:13:37 seafile-data/
drwxr-xr-x 8 seafile seafile 4096 2022-07-05 14:16:47 seafile-pro-server-9.0.6/
drwxr-xr-x 8 root root 4096 2022-08-10 15:07:41 seafile-pro-server-9.0.7/
lrwxrwxrwx 1 root root 24 2022-08-15 14:59:25 seafile-server-latest -> seafile-pro-server-9.0.7/
drwxr-xr-x 4 seafile seafile 4096 2022-08-05 23:21:48 seahub-data/
可以看到实际源文件路径 seafile-pro-server-9.0.7 和软连接目录 seafile-server-latest 权限、用户组异常
chmod 777 -R /home/seafile/seafile
chown -R seafile:seafile /home/seafile/seafile
简单粗暴修复完,继续重启 seafile 、seahub
systemctl restart seafile && systemctl restart seahub
没有任何报错,网页前端也能正常访问了