从社区版迁移到企业版,office预览一直转圈

服务器是从 windows server 迁移到 Linux server,再从 sqlite 转成 mysql

今天试了试企业版,能正常运作.但是office预览功能无法运作.

点开 work 文档一直转圈.

以为是中文问题,但是默认的 seafile-tutorial.doc 手册是全英文的也是一直转圈.

查日志如下

[root@localhost logs]# tail -f seafevents.log 
DEBUG: Process /usr/lib64/libreoffice/program/soffice.bin (pid=7757) exited with 77.
Error: Unable to connect or start own listener. Aborting.
Using office base path: /usr/lib64/libreoffice
Using office binary path: /usr/lib64/libreoffice/program
LibreOffice listener successfully started. (pid=7757)

[2016-11-19 17:07:11,460] [WARNING] failed to convert <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba> to pdf
[2016-11-19 17:07:11,463] [DEBUG] removing temporary document /tmp/tmpdxmB5k.doc
[2016-11-19 17:13:43,597] [INFO] starts to index files
[2016-11-19 17:13:43,597] [DEBUG] Running command: "/usr/bin/python2.7" "-m" "seafes.update_repos" "--logfile" "/home/haiwen/logs/index.log" "update", cwd = /home/haiwen/seafile-pro-server-6.0.3/pro/python/seafes
[2016-11-19 17:15:37,867] [DEBUG] start to fetch task <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba>
[2016-11-19 17:15:37,882] [DEBUG] start to convert task <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba>
[2016-11-19 17:15:38,753] [WARNING] error when invoking libreoffice: Verbosity set to level 3
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
DEBUG: Process /usr/lib64/libreoffice/program/soffice.bin (pid=7847) exited with 77.
Error: Unable to connect or start own listener. Aborting.
Using office base path: /usr/lib64/libreoffice
Using office binary path: /usr/lib64/libreoffice/program
LibreOffice listener successfully started. (pid=7847)

[2016-11-19 17:15:38,753] [WARNING] failed to convert <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba> to pdf
[2016-11-19 17:15:38,753] [DEBUG] removing temporary document /tmp/tmpxtMsIU.doc
[2016-11-19 17:22:25,830] [DEBUG] start to fetch task <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba>
[2016-11-19 17:22:25,842] [DEBUG] start to convert task <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba>
[2016-11-19 17:22:26,758] [WARNING] error when invoking libreoffice: Verbosity set to level 3
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
DEBUG: Process /usr/lib64/libreoffice/program/soffice.bin (pid=7889) exited with 77.
Error: Unable to connect or start own listener. Aborting.
Using office base path: /usr/lib64/libreoffice
Using office binary path: /usr/lib64/libreoffice/program
LibreOffice listener successfully started. (pid=7889)

[2016-11-19 17:22:26,759] [WARNING] failed to convert <type: doc, id: b88ab96740ef53249b9d21fb3fa28050842266ba> to pdf
[2016-11-19 17:22:26,759] [DEBUG] removing temporary document /tmp/tmpD9pvVl.doc

升级到企业版后需要按照文档来配置和启动 office 预览。你相应的依赖包都还没有安装。

我已经按照文档安装以下

[root@localhost ~]# yum install java-1.7.0-openjdk poppler-utils libreoffice-headless libreoffice-pyuno
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: mirrors.163.com
 * updates: mirrors.163.com
软件包 1:java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64 已安装并且是最新版本
软件包 poppler-utils-0.26.5-5.el7.x86_64 已安装并且是最新版本
软件包 1:libreoffice-headless-4.3.7.2-5.el7_2.1.x86_64 已安装并且是最新版本
软件包 1:libreoffice-pyuno-4.3.7.2-5.el7_2.1.x86_64 已安装并且是最新版本

是需要启动libreoffice么?

另外 office预览的选项默认是 true

可以试试这个 https://manual.seafile.com/deploy_pro/faq_for_seafile_pro_server.html#faq-about-libreoffice-based-office-documents-preview

找到问题了,是因为我的 seafile 运行在用户 seafile 中,而用户没有家目录.导致用户无法运行libreoffice.
直接指定 /home/haiwen 为用户家目录解决.

systemctl stop seafile
usermod -d /home/haiwen seafile
systemctl start seafile