Office preview not working

i followed the steps in https://manual.seafile.com/deploy_pro/office_documents_preview.html.
i added config in seafevents.conf:

[OFFICE CONVERTER]
enabled = true
workers = 1
outputdir = /tmp/
max-pages = 50
max-size = 2

when i now click on a pdf or odt file i only get a spinning wheel in the browser.

when inspecting the network traffic i get

https://example.com/cloud/office-convert/status/?repo_id=1b5de5bb-…&commit_id=750036…&path=%2Ftest.pdf&page=1&_=1476349727790

{"status": "PROCESSING", "info": {"processed_pages": 0}, "success": true}

after a while i get “Es tut uns leid, aber die angefragte Seite wurde nicht gefunden. (sorry, requested page not found)” in the browser.

==> seahub_django_request.log <==
2016-10-13 17:07:23,608 [WARNING] django.request:170 get_response Not Found: /wolke/office-convert/status/

no other logs.

is there a problem, that the office converter is running pyhton 3 and seafile server pyhton 2.7?

/usr/bin/python3 /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py -vvv --pipe seafilepipe -l
seafile  28842     1  0 11:00 ?        00:00:00 python2.7 /data/seafile/seafile-pro-server-6.0.1/seahub/manage.py runfcgi host=127.0.0.1 port=8000 ...

Anything in logs/seafevents.log?

i am using

  • LibreOffice 5.1.4.2 10m0(Build:2)
  • seafile server pro 6.0.1 beta
  • seafile behind apache with proxy/redirects, installed at non-root, eg. https://example.com/cloud

just tried it again. no logs when accessing a pdf or doc file.

i just stoped and started all again.
in seafenvents.log:

2016-10-13 12:36:56,702] [DEBUG] office enabled: True
[2016-10-13 12:36:56,702] [DEBUG] office convert workers: 1
[2016-10-13 12:36:56,702] [DEBUG] office outputdir: /tmp/
[2016-10-13 12:36:56,702] [DEBUG] office convert max pages: 50
[2016-10-13 12:36:56,702] [DEBUG] office convert max size: 2 MB
[2016-10-13 12:36:58,210] [DEBUG] Running command: "/usr/bin/python3" "/data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py" "-vvv" "--pipe" "seafilepipe" "-l", cwd = /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter
[2016-10-13 12:36:58,215] [INFO] office converter started

temp-file is created in /tmp, file is OK (moved in the docroot of apache)

in seafevents.log i get

[2016-10-13 12:40:15,100] [DEBUG] start to fetch task <type: doc, id: b88ab9...>
[2016-10-13 12:40:15,193] [DEBUG] start to convert task <type: doc, id:b88ab9...>

i now have two soffice processes

seafile  29776 29765  0 12:36 ?        00:00:00 /usr/lib/libreoffice/program/soffice.bin --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore --accept=pipe,name=seafilepipe;urp;StarOffice.ComponentContext
seafile  29856     1  0 12:40 ?        00:00:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=pipe,name=seafilepipe;urp;StarOffice.ComponentContext

Sorry but I really can’t see why would this happen. Is there anything special with your seafile server configuration? E.g. have you edited the python files in the seahub directory?

https://example.com/cloud/office-convert/status/?repo_id=1b5de5bb-…&commit_id=750036…&path=%2Ftest.pdf&page=1&_=1476349727790

From the log your url root is /wokle/, but here the url root is /cloud/ , are you sure they are the same?

yes, thats correct. indeed it is /wolke - i wanted to hide it here and forgot to replace it in my post…

so, i just started all again. removed all the tmp-dirs in /tmp. stopped apache and seafile.
found a hint about

ProxyPass /seafile fcgi://127.0.0.1:8000/seafile

in https://github.com/haiwen/seafile/issues/1186

this is the log when accessing a pdf file

==> seafevents.log <==
[2016-10-14 10:42:36,925] [DEBUG] start to fetch task <type: pdf, id: 91f95efb3813106524c622882053096ad88270cb>
[2016-10-14 10:42:36,964] [ERROR] failed to convert <type: pdf, id: 91f95efb3813106524c622882053096ad88270cb> to html
Traceback (most recent call last):
  File "/data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/task_manager.py", line 135, in _convert_pdf_to_html
    task.pdf, task.htmldir, task_manager.max_pages, progress_callback)
  File "/data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/convert.py", line 311, in pdf_to_html2
    pdf_info = self._get_pdf_info_json(pdf)
  File "/data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/convert.py", line 278, in _get_pdf_info_json
    output = _check_output(['pdfinfo', pdf])
  File "/data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/convert.py", line 31, in _check_output
    process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[2016-10-14 10:42:36,965] [DEBUG] removing temporary document /tmp/tmpQNbsO0.pdf

i tried to convert a pdf from command line:

 /usr/bin/python3 /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py -vvv -f html -o test.html test.pdf
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
Input file: test.pdf
Selected output format: HTML Document (OpenOffice.org Writer) [.html]
Selected office filter: HTML (StarWriter)
Used doctype: document
unoconv: UnoException during export phase:
Unable to store document to file:///tmp/test.html (ErrCode 3088)

Properties: ((com.sun.star.beans.PropertyValue){ Name = (string)"FilterName", Handle = (long)0x0, Value = (any){ (string)"HTML (StarWriter)" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"OutputStream", Handle = (long)0x0, Value = (any){ (com.sun.star.uno.XInterface)0x221d548{, supportedInterfaces={com.sun.star.lang.XTypeProvider,com.sun.star.io.XOutputStream}} }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"Overwrite", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE })

when doing the same with odt it works:

/usr/bin/python3 /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py -vvv -f html -o test.html test.pdf
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
Input file: test.pdf
Selected output format: HTML Document (OpenOffice.org Writer) [.html]
Selected office filter: HTML (StarWriter)
Used doctype: document
unoconv: UnoException during export phase:
Unable to store document to file:///tmp/test.html (ErrCode 3088)

Properties: ((com.sun.star.beans.PropertyValue){ Name = (string)"FilterName", Handle = (long)0x0, Value = (any){ (string)"HTML (StarWriter)" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"OutputStream", Handle = (long)0x0, Value = (any){ (com.sun.star.uno.XInterface)0x221d548{, supportedInterfaces={com.sun.star.lang.XTypeProvider,com.sun.star.io.XOutputStream}} }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"Overwrite", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE })
root@v22016103886338142:/tmp# /usr/bin/python3 /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py -vvv -f odt -o test.odt test.pdf
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
Input file: test.pdf
Selected output format: ODF Text Document [.odt]
Selected office filter: writer8
Used doctype: document

version gives me:

 /usr/bin/python3 /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py --version
unoconv 0.6
Written by Dag Wieers <dag@wieers.com>
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux
python 3.5.2 (default, Jul  5 2016, 12:43:10)
[GCC 5.4.0 20160609]
LibreOffice 5.1

what seems to work is

/usr/bin/libreoffice --convert-to html test.pdf

Thanks for the detailed report. This time the error is clear: you need to install the “poppler-utils” package on your server.

i have installed poppler-utils but no luck. preview still not possible.
when i run

 /usr/bin/python3 /data/seafile/seafile-pro-server-6.0.1/pro/python/seafevents/office_converter/unoconv.py -vvv -f html -o test.html test.pdf

i still get the error 3088 (when i search the net, it says that this is somehow a permission/acl problem, but i can’t see what)

Last time your error in seafevents.log indicates the program “pdfinfo” is not found on your system, which is used by seafile server for office doc preview, that’s why I asked you to install the poppler-utils package, which provides the “pdfinfo” program.

What’s in the seafevents.log this time?

Thanxs for your help.
I have “reinstalled” seafile-server-pro (at least i have unpacked the tar-file). think i messed up with some file attributes and executable vs. non-executable.

it is now working :slight_smile:

markus

i first thought, that the problem was solved. but it is not.
see my new posting Office Preview not working - when started as root with sudo